From: pavelpa Date: Thu, 28 Jan 2010 11:25:26 +0000 (+0000) Subject: conflicts updated correctly X-Git-Tag: 0.5.0~156 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/438699c9c023a61e208699e4fdfcb02885766269 conflicts updated correctly - TODO: needs to do some drawing optimizations --- diff --git a/src/mvc/treeview.cpp b/src/mvc/treeview.cpp index ccc2703..0b3b632 100644 --- a/src/mvc/treeview.cpp +++ b/src/mvc/treeview.cpp @@ -3,6 +3,7 @@ #include "treeview.h" #include "delegate.h" #include "event.h" +#include "conference.h" #include "eventmodel.h" #ifdef MAEMO @@ -47,17 +48,31 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP { // handle Favourite Control clicked Event event = Event::getById(aIndex.data().toInt(),1); + + QList conflicts = Event::conflictEvents(event.id(),Conference::activeConference()); if(event.isFavourite()) event.setFavourite(false); else event.setFavourite(true); event.update("favourite"); + qDebug() << " FAVOURITE [" << qVariantValue(aIndex.data()) << "] -> " << event.isFavourite(); // update EVENT_CONFLICT table event.updateConflicts(); + if(event.isFavourite()) + { + // event has became 'favourite' and so 'conflicts' list may have changed + conflicts = Event::conflictEvents(event.id(),Conference::activeConference()); + } + // since the Favourite icon has changed, update TreeViews accordingly // all TreeViews have to listen on this signal emit(eventHasChanged(event.id())); + + // have to emit 'eventHasChanged' signal on all events in conflict + for(int i=0; i