minor fix
authorpavelpa <pavelpa@localhost>
Wed, 13 Jan 2010 21:59:20 +0000 (21:59 +0000)
committerpavelpa <pavelpa@localhost>
Wed, 13 Jan 2010 21:59:20 +0000 (21:59 +0000)
src/model/conference.h
src/sql/sqlengine.cpp

index c904b51..c6c8e01 100644 (file)
@@ -23,11 +23,8 @@ public:
     QString subtitle() const { return value("subtitle").toString(); }
     QString venue() const { return value("venue").toString(); }
     QString city() const { return value("city").toString(); }
-    // TODO: there is some problem with converting "Time_t" to QDateTime: had to manually add 1 day
-    // NEEDS TO BE FIXED
-    QDate start() const { return value("start").toDateTime().addDays(1).date(); }
-    QDate end() const { return value("end").toDateTime().addDays(1).date(); }
-    //
+    QDate start() const { return value("start").toDate(); }
+    QDate end() const { return value("end").toDate(); }
     int days() const { return value("days").toInt(); }
     int dayChange() const { return value("day_change").toInt(); } // in seconds from 00:00
     int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds
index 48db577..a7cd626 100644 (file)
@@ -67,8 +67,8 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference)
                          .arg(aConference["subtitle"]) \
                          .arg(aConference["venue"]) \
                          .arg(aConference["city"]) \
-                         .arg(QDateTime(QDate::fromString(aConference["start"],DATE_FORMAT)).toTime_t()) \
-                         .arg(QDateTime(QDate::fromString(aConference["end"],DATE_FORMAT)).toTime_t()) \
+                         .arg(QDateTime(QDate::fromString(aConference["start"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t()) \
+                         .arg(QDateTime(QDate::fromString(aConference["end"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t()) \
                          .arg(aConference["days"]) \
                          .arg(-QTime::fromString(aConference["day_change"],TIME_FORMAT).secsTo(QTime(0,0))) \
                          .arg(-QTime::fromString(aConference["timeslot_duration"],TIME_FORMAT).secsTo(QTime(0,0)));