[svn-upgrade] Integrating new upstream version, fosdem-schedule (0.4.1+ds) upstream/0.4.1+ds
authorgregor herrmann <gregoa@debian.org>
Fri, 5 Mar 2010 00:06:08 +0000 (00:06 -0000)
committergregor herrmann <gregoa@debian.org>
Fri, 5 Mar 2010 00:06:08 +0000 (00:06 -0000)
data/maemo/fosdem-schedule.desktop
src/alarm/alarm.cpp
src/fosdem.sqlite
src/gui/about.ui
src/mvc/event.cpp
src/sql/sqlengine.cpp

index e3621d7aa07be3e3b513be125ed64ea53f3fa7fb..0d4654e98badd94ac30fed9fa063b82a13bdde70 100644 (file)
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Encoding=UTF-8
-Version=0.4
+Version=0.4.1
 Type=Application
 Name=FOSDEM'10
 Exec=/usr/bin/fosdem-schedule
index 006fc79f0d9db8732643ebac08b1211cbd77fb34..558f26f844f4e99cdc4897067e70e4d388d85a18 100644 (file)
@@ -47,7 +47,7 @@ int Alarm::addAlarm(int aEventId, const QDateTime &aDateTime)
     qDebug() << "UTC: " << local.toTime_t();
     local.setTimeSpec(Qt::LocalTime);
     qDebug() << "LocalTime: " << local.toTime_t();
-    
+
     eve->alarm_time = local.toTime_t();
     eve->flags = ALARM_EVENT_BOOT;
 
index 97d6adad052b5b7b11c06ccbcbddba61c8e89e53..2e6eccc36b8de0d76f7f3dfe5ac08e22d2c88f88 100644 (file)
Binary files a/src/fosdem.sqlite and b/src/fosdem.sqlite differ
index cae3f28b30a4328a4c1e786adfd48171a9720589..5a549ffb03b6255cd96aa6a88abc7e6a771c4fbc 100644 (file)
               <item>
                <widget class="QLabel" name="label_2" >
                 <property name="text" >
-                 <string>Version 0.4</string>
+                 <string>Version 0.4.1</string>
                 </property>
                </widget>
               </item>
index cf0a2bdeccbc6ea295f1fef29c91ec93760d2315..40d9f32128e6ffddf691d77f8c01b8fb4af1806a 100644 (file)
@@ -143,8 +143,9 @@ int Event::roomId()
     if ( mRoomId == 0 )
     {
         QSqlQuery query;
-        query.prepare("SELECT xid_room FROM event_room WHERE xid_event = :id");
+        query.prepare("SELECT xid_room FROM event_room WHERE xid_event = :id AND xid_conference = :conf");
         query.bindValue(":id", id());
+        query.bindValue(":conf", conferenceId());
         if (!query.isActive())
             if (!query.exec())
                 throw OrmSqlException(query.lastError().text());
@@ -164,8 +165,9 @@ QStringList Event::persons()
     {
         QSqlQuery query;
         // TODO: conference ID isn't used here
-        query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id");
+        query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id AND event_person.xid_conference = :conf");
         query.bindValue(":id", id());
+        query.bindValue(":conf", conferenceId());
         query.exec();
         // TODO: handle qeury error
         //qDebug() << query.lastError();
index 3d4b30e44fa6389cf5fb052e86cd73087f3983b8..90cb989acac948d0e84b98f63a4eebaea08d5feb 100644 (file)
@@ -152,7 +152,10 @@ void SqlEngine::addEventToDB(QHash<QString,QString> &aEvent)
             trackId = track.insert();
             /*qDebug() << QString("DEBUG: Track %1 added to DB").arg(name);*/
         }
-        QDateTime startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT));
+        QDateTime startDateTime;
+        startDateTime.setTimeSpec(Qt::UTC);
+        startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT),Qt::UTC);
+        qDebug() << "startDateTime: " << startDateTime.toString();
         QString values = QString("'%1', '%2', '%3', '%4', '%5', '%6', '%7', ? , ? , ? , ? , ? , '%8', '%9'") \
                          .arg(aEvent["conference_id"]) \
                          .arg(aEvent["id"]) \
@@ -168,6 +171,7 @@ void SqlEngine::addEventToDB(QHash<QString,QString> &aEvent)
             QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_track, type, language, tag, title, subtitle, abstract, description, favourite, alarm) VALUES (%1)")
             .arg(values);
 
+        qDebug() << query;
         QSqlQuery result;
         result.prepare(query);
         result.bindValue(0,aEvent["tag"]);
@@ -293,7 +297,7 @@ bool SqlEngine::createTables(QSqlDatabase &aDatabase)
             "description VARCHAR, "
             "favourite INTEGER DEFAULT 0, "
             "alarm INTEGER DEFAULT 0, "
-            "PRIMARY KEY (xid_conference,id), "
+            "PRIMARY KEY (xid_conference,id) ON CONFLICT REPLACE, "
             "FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), "
             "FOREIGN KEY(xid_track) REFERENCES TRACK(id));");
 
@@ -301,7 +305,7 @@ bool SqlEngine::createTables(QSqlDatabase &aDatabase)
             "xid_conference INTEGER NOT NULL, "
             "xid_event INTEGER NOT NULL, "
             "xid_person INTEGER NOT NULL, "
-            "UNIQUE ( xid_conference, xid_event, xid_person ) ON CONFLICT IGNORE, "
+            "UNIQUE ( xid_conference, xid_event, xid_person ) ON CONFLICT REPLACE, "
             "FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), "
             "FOREIGN KEY(xid_event) REFERENCES EVENT(id), "
             "FOREIGN KEY(xid_person) REFERENCES PERSON(id));");
@@ -310,7 +314,7 @@ bool SqlEngine::createTables(QSqlDatabase &aDatabase)
             "xid_conference INTEGER NOT NULL, "
             "xid_event INTEGER NOT NULL, "
             "xid_room INTEGER NOT NULL, "
-            "UNIQUE ( xid_conference, xid_event, xid_room ) ON CONFLICT IGNORE, "
+            "UNIQUE ( xid_conference, xid_event, xid_room ) ON CONFLICT REPLACE, "
             "FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), "
             "FOREIGN KEY(xid_event) REFERENCES EVENT(id), "
             "FOREIGN KEY(xid_room) REFERENCES ROOM(id));");
@@ -321,7 +325,7 @@ bool SqlEngine::createTables(QSqlDatabase &aDatabase)
             "xid_event INTEGER NOT NULL, "
             "name VARCHAR, "
             "url VARCHAR NOT NULL, "
-            "UNIQUE ( xid_conference, xid_event, url ) ON CONFLICT IGNORE, "
+            "UNIQUE ( xid_conference, xid_event, url ) ON CONFLICT REPLACE, "
             "FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), "
             "FOREIGN KEY(xid_event) REFERENCES EVENT(id));");
     }
@@ -368,7 +372,6 @@ int SqlEngine::searchEvent(int aConferenceId, const QHash<QString,QString> &aCol
 
     execQuery( db, query );
 
-    //TODO: retun number of rows from SEARCH_EVENT
     return 1;
 }