grouping by time equation changed - beter group deviding, also according to favourites
authorkorrco <korrco@localhost>
Mon, 18 Jan 2010 18:15:41 +0000 (18:15 +0000)
committerkorrco <korrco@localhost>
Mon, 18 Jan 2010 18:15:41 +0000 (18:15 +0000)
src/gui/mainwindow.cpp
src/gui/mainwindow.h
src/mvc/eventmodel.cpp

index d068c74..b527e48 100644 (file)
@@ -120,7 +120,10 @@ void MainWindow::importSchedule()
     {
         int confId = 1;
         // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
-        dayNavigator->setDates(Conference::getById(confId).start(), Conference::getById(confId).end());
+        QDate aStartDate = Conference::getById(confId).start();
+        QDate aEndDate = Conference::getById(confId).end();
+        dayNavigator->setDates(aStartDate, aEndDate);
+        activityDayNavigator->setDates(aStartDate, aEndDate);
     }
 }
 
@@ -172,24 +175,3 @@ void MainWindow::updateActivitiesDayView(const QDate &aDate)
     activityDayTreeView->reset();
     activityDayNavigator->show();
 }
-
-void MainWindow::updateView(int tabIndex)
-{
-    //TODO korinpa: change to enum or names ?
-    qDebug() << "updateView index: " << tabIndex;
-    if (tabIndex == 0)
-    {
-        QDate date = dayNavigator->getCurrentDate();
-        updateDayView(date);
-    }
-    else if (tabIndex == 1)
-    {
-        updateFavView();
-    }
-    else if (tabIndex == 2)
-    {
-        QDate date = activityDayNavigator->getCurrentDate();
-        updateActivitiesDayView(date);
-    }
-}
-
index 4c1c483..20e72a8 100644 (file)
@@ -22,7 +22,6 @@ private slots:
     void updateFavView();
     /*void updateFavViewComplete();*/
     void updateActivitiesDayView(const QDate &aDate);
-    void updateView(int tabIndex);
 private:
     SqlEngine *mSqlEngine;
     ScheduleXmlParser *mXmlParser;
index d41aab8..2753223 100644 (file)
@@ -27,7 +27,7 @@ void EventModel::createTimeGroups()
     {
         QTime eventTime = mEvents.at(i).start().time();
 
-        if (nextGroupTime < eventTime)
+        if (nextGroupTime <= eventTime)
         {
             mGroups.last().mChildCount = i - mGroups.last().mFirstEventIndex;
             mGroups << EventModel::Group(QString("%1 - %2").arg(nextGroupTime.toString("HH:mm"),