Update tabs 2
authorfortefr <fortefr@localhost>
Tue, 19 Jan 2010 09:58:48 +0000 (09:58 +0000)
committerfortefr <fortefr@localhost>
Tue, 19 Jan 2010 09:58:48 +0000 (09:58 +0000)
-This line, and those below, will be ignored--

M    src/gui/mainwindow.cpp
M    src/gui/mainwindow.h

src/gui/mainwindow.cpp
src/gui/mainwindow.h

index 101a4ca..5f7a5e3 100644 (file)
@@ -150,28 +150,37 @@ void MainWindow::aboutApp()
     dialog.exec();
 }
 
-void MainWindow::updateDayView(const QDate aDate)
+void MainWindow::updateDayView(const QDate &aDate)
 {
     int confId = 1;
-    static_cast<EventModel*>(dayTreeView->model())->loadEvents(Conference::getById(confId).start(),confId);
+    static_cast<EventModel*>(dayTreeView->model())->loadEvents(aDate,confId);
     dayTreeView->reset();
     dayNavigator->show();
 }
 
-void MainWindow::updateTab(const int n)
+void MainWindow::updateTab(const int aIndex)
 {
     int confId = 1;
-    if(n) //index 1 of tabWidget: favouriteTab
+    switch(aIndex)
     {
-        static_cast<EventModel*>(favTreeView->model())->loadFavEvents(Conference::getById(confId).start(),confId);
-        favTreeView->reset();
-    }
-    else //index 0 of tabWidget: dayViewTab
-    {
-        static_cast<EventModel*>(dayTreeView->model())->loadEvents(Conference::getById(confId).start(),confId);
-        dayTreeView->reset();
-    }
-    //TODO: update of activitiesTab needed?
+    case 0://index 0 of tabWidget: dayViewTab
+        {
+            static_cast<EventModel*>(dayTreeView->model())->loadEvents(Conference::getById(confId).start(),confId);
+            dayTreeView->reset();
+        }
+        break;
+    case 1: //index 1 of tabWidget: favouritesTab
+        {
+                static_cast<EventModel*>(favTreeView->model())->loadFavEvents(Conference::getById(confId).start(),confId);
+                favTreeView->reset();
+        }
+        break;
+    default:
+        {
+            //TODO: update of activitiesTab needed?
+        }
+    };
+
     dayNavigator->show();
 }
 
index dcbc14a..1d7fcf7 100644 (file)
@@ -18,7 +18,7 @@ private slots:
     void importSchedule();
     void showParsingProgress(int aStatus);
     void aboutApp();
-    void updateDayView(const QDate aDate);
+    void updateDayView(const QDate &aDate);
     void updateTab(const int n);
     /*void updateFavViewComplete();*/
     void updateActivitiesDayView(const QDate &aDate);