]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/eventmodel.cpp
Adjust shown event time when displayTimeShift is set.
[toast/confclerk.git] / src / mvc / eventmodel.cpp
index e4e236795a88997cef2be967469b28d14edf92db..ac131a4099b52d6d023d8b690a7593d6e2f0cd57 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2015 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2017 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
@@ -22,6 +22,8 @@
 #include "track.h"
 #include "room.h"
 
+#include <application.h>
+
 const QString EventModel::COMMA_SEPARATOR = ", ";
 
 EventModel::EventModel()
@@ -34,7 +36,10 @@ void EventModel::Group::setTitle(const QList<Event>& mEvents) {
     for (int i = mFirstEventIndex; i != mFirstEventIndex + mChildCount; ++i) {
         endTime = qMax(mEvents.at(i).start().addSecs(mEvents.at(i).duration()), endTime);
     }
-    mTitle = QString("%1 - %2").arg(startTime.toString("HH:mm")).arg(endTime.toString("HH:mm"));
+    Conference& conference = ((Application*) qApp)->activeConference();
+    QTime s = conference.shiftTime(startTime.time());
+    QTime e = conference.shiftTime(endTime.time());
+    mTitle = QString("%1 - %2").arg(s.toString("HH:mm")).arg(e.toString("HH:mm"));
 }
 
 
@@ -176,7 +181,7 @@ QModelIndex EventModel::index(int row, int column, const QModelIndex& parent) co
 
     if (!parent.isValid())
     {
-        return createIndex(row, column, (quintptr) 0);
+        return createIndex(row, column);
     }
     else if (parent.internalId() == 0)
     {
@@ -201,7 +206,7 @@ QModelIndex EventModel::parent(const QModelIndex & index) const
 
         Event * event = static_cast<Event*>(index.internalPointer());
 
-        return createIndex(mParents[event->id()], 0, (quintptr) 0);
+        return createIndex(mParents[event->id()], 0);
     }
 
     return QModelIndex();