From: Philipp Spitzer Date: Mon, 17 Oct 2011 18:15:33 +0000 (+0000) Subject: The favorite tab gets updated again after changing the favorite state. X-Git-Tag: 0.5.5~44 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/dc66a9113c07a4682c6036157dbc0f3708c4af82 The favorite tab gets updated again after changing the favorite state. --- diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 730755d..a9748a7 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -84,11 +84,11 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent) QNetworkProxy::setApplicationProxy(proxy); // event details have changed - connect(dayTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); - connect(favsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); - connect(tracksTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); - connect(roomsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); - connect(searchTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(redisplayEvent(int,bool))); + connect(dayTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool))); + connect(favsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool))); + connect(tracksTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool))); + connect(roomsTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool))); + connect(searchTabContainer, SIGNAL(eventChanged(int,bool)), SLOT(onEventChanged(int,bool))); // date has changed connect(dayNavigator, SIGNAL(dateChanged(QDate)), dayTabContainer, SLOT(redisplayDate(QDate))); @@ -154,16 +154,16 @@ void MainWindow::on_searchAction_triggered() { } - -void MainWindow::redisplayEvent(int aEventId, bool aReloadModel) -{ +void MainWindow::onEventChanged(int aEventId, bool favouriteChanged) { dayTabContainer->redisplayEvent(aEventId); - favsTabContainer->redisplayEvent(aEventId,aReloadModel); + if (favouriteChanged) favsTabContainer->redisplayDate(dayNavigator->curDate()); + else favsTabContainer->redisplayEvent(aEventId); tracksTabContainer->redisplayEvent(aEventId); roomsTabContainer->redisplayEvent(aEventId); searchTabContainer->redisplayEvent(aEventId); } + void MainWindow::useConference(int id) { if (id == -1) // in case no conference is active diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 1d38333..127620d 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -48,7 +48,7 @@ private slots: void on_nowAction_triggered(); void on_searchAction_triggered(); - void redisplayEvent(int aEventId, bool aReloadModel); + void onEventChanged(int aEventId, bool favouriteChanged); // TODO: remove void networkQueryFinished(QNetworkReply*); void importFromNetwork(const QString&); diff --git a/src/gui/tabcontainer.cpp b/src/gui/tabcontainer.cpp index 694ce78..822a80b 100644 --- a/src/gui/tabcontainer.cpp +++ b/src/gui/tabcontainer.cpp @@ -86,9 +86,8 @@ void TabContainer::displayConflicts(const QModelIndex &aIndex) } -void TabContainer::redisplayEvent(int aEventId, bool aReloadModel) { - /* if (aReloadModel) updateTreeView(dayNavigator->curDate()); - else */ static_cast(treeView->model())->updateModel(aEventId); +void TabContainer::redisplayEvent(int aEventId) { + static_cast(treeView->model())->updateModel(aEventId); } diff --git a/src/gui/tabcontainer.h b/src/gui/tabcontainer.h index fa85b73..437fbe4 100644 --- a/src/gui/tabcontainer.h +++ b/src/gui/tabcontainer.h @@ -44,7 +44,7 @@ signals: void eventChanged(int aEventId, bool aReloadModel); public slots: - virtual void redisplayEvent(int aEventId, bool aReloadModel = false); + virtual void redisplayEvent(int aEventId); void redisplayDate(const QDate& curDate); protected slots: diff --git a/src/mvc/treeview.cpp b/src/mvc/treeview.cpp index 6f514e9..57de752 100644 --- a/src/mvc/treeview.cpp +++ b/src/mvc/treeview.cpp @@ -79,13 +79,13 @@ bool TreeView::testForControlClicked(const QModelIndex &aIndex, const QPoint &aP conflicts = Event::conflictEvents(event.id(),Conference::activeConference()); } - // have to emit 'eventHasChanged' signal on all events in conflict + // have to emit 'eventChanged' signal on all events in conflict for(int i=0; i