Quick fix for ticket: #32: if the schedule XML doesn't contain a city, we put "n...
authorgregor herrmann <gregoa@debian.org>
Mon, 15 Aug 2011 12:41:19 +0000 (12:41 +0000)
committergregor herrmann <gregoa@debian.org>
Mon, 15 Aug 2011 12:41:19 +0000 (12:41 +0000)
In the long run we might want to find a system for changing the database scheme; too bad sqlite has only limited ALTER TABLE support.

src/sql/sqlengine.cpp

index 9ee08ae..1c1c0cf 100644 (file)
@@ -109,6 +109,11 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference)
 
         if(!confId) // conference 'aConference' isn't in the table => insert
         {
+            // HACK
+            // When city is empty, assign a dummy value. We probably want to find a way to change the database scheme ...
+            // cf. #32
+            if (aConference["city"] == "") aConference["city"] = "n/a";
+
             QSqlQuery query(db);
             query.prepare("INSERT INTO CONFERENCE (title,url,subtitle,venue,city,start,end,days,"
                                                     "day_change,timeslot_duration,active) "