The favorite tab gets updated again after changing the favorite state.
[toast/confclerk.git] / src / gui / mainwindow.cpp
index 730755d87244391afa21f1d33cc46554203321fd..a9748a73decab5fc23f58cc21823f6b39791518d 100644 (file)
@@ -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