Changeset 438699c


Ignore:
Timestamp:
01/28/10 12:25:26 (13 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
412cef6
Parents:
f5d27c7
Message:

conflicts updated correctly

  • TODO: needs to do some drawing optimizations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/treeview.cpp

    rf5d27c7 r438699c  
    44#include "delegate.h"
    55#include "event.h"
     6#include "conference.h"
    67#include "eventmodel.h"
    78
     
    4849                // handle Favourite Control clicked
    4950                Event event = Event::getById(aIndex.data().toInt(),1);
     51
     52                QList<Event> conflicts = Event::conflictEvents(event.id(),Conference::activeConference());
    5053                if(event.isFavourite())
    5154                    event.setFavourite(false);
     
    5356                    event.setFavourite(true);
    5457                event.update("favourite");
     58
    5559                qDebug() << " FAVOURITE [" << qVariantValue<QString>(aIndex.data()) << "] -> " << event.isFavourite();
    5660                // update EVENT_CONFLICT table
    5761                event.updateConflicts();
     62                if(event.isFavourite())
     63                {
     64                    // event has became 'favourite' and so 'conflicts' list may have changed
     65                    conflicts = Event::conflictEvents(event.id(),Conference::activeConference());
     66                }
     67
    5868                // since the Favourite icon has changed, update TreeViews accordingly
    5969                // all TreeViews have to listen on this signal
    6070                emit(eventHasChanged(event.id()));
     71
     72                // have to emit 'eventHasChanged' signal on all events in conflict
     73                for(int i=0; i<conflicts.count(); i++)
     74                    emit(eventHasChanged(conflicts[i].id()));
     75
    6176                handled = true;
    6277            }
Note: See TracChangeset for help on using the changeset viewer.