Remove unsed (and removed from db) 'days' column fro xml parser and all sql parts.
authorgregor herrmann <gregoa@debian.org>
Tue, 25 Sep 2012 18:31:03 +0000 (18:31 +0000)
committergregor herrmann <gregoa@debian.org>
Tue, 25 Sep 2012 18:31:03 +0000 (18:31 +0000)
src/mvc/conference.cpp
src/mvc/conference.h
src/sql/schedulexmlparser.cpp
src/sql/sqlengine.cpp

index 77cf596..655e5f2 100644 (file)
@@ -28,7 +28,6 @@ QSqlRecord const Conference::sColumns = Conference::toRecord(QList<QSqlField>()
     << QSqlField("city", QVariant::String)
     << QSqlField("start", QVariant::DateTime)
     << QSqlField("end", QVariant::DateTime)
-    << QSqlField("days", QVariant::Int)
     << QSqlField("day_change", QVariant::Int)
     << QSqlField("timeslot_duration", QVariant::Int)
     << QSqlField("active", QVariant::Bool)
index fbb3a18..1b3157f 100644 (file)
@@ -45,7 +45,6 @@ public:
     QString city() const { return value("city").toString(); }
     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
     bool isActive() const { return value("active").toBool(); }
index 6e6d653..e4a40f6 100644 (file)
@@ -61,7 +61,6 @@ void ScheduleXmlParser::parseData(const QByteArray &aData, const QString& url, i
             conference["city"] = conferenceElement.firstChildElement("city").text();
             conference["start"] = conferenceElement.firstChildElement("start").text(); // date
             conference["end"] = conferenceElement.firstChildElement("end").text(); // date
-            conference["days"] = conferenceElement.firstChildElement("days").text(); // int
             conference["day_change"] = conferenceElement.firstChildElement("day_change").text(); // time
             conference["timeslot_duration"] = conferenceElement.firstChildElement("timeslot_duration").text(); // time
             conference["url"] = url;
index c067745..8244861 100644 (file)
@@ -130,11 +130,11 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int confe
     QSqlQuery query(db);
     if (conferenceId <= 0) // insert conference
     {
-        query.prepare("INSERT INTO CONFERENCE (title,url,subtitle,venue,city,start,end,days,"
+        query.prepare("INSERT INTO CONFERENCE (title,url,subtitle,venue,city,start,end,"
                                                 "day_change,timeslot_duration,active) "
-                        " VALUES (:title,:url,:subtitle,:venue,:city,:start,:end,:days,"
+                        " VALUES (:title,:url,:subtitle,:venue,:city,:start,:end,"
                                                 ":day_change,:timeslot_duration,:active)");
-        foreach (QString prop_name, (QList<QString>() << "title" << "url" << "subtitle" << "venue" << "city" << "days")) {
+        foreach (QString prop_name, (QList<QString>() << "title" << "url" << "subtitle" << "venue" << "city")) {
             query.bindValue(QString(":") + prop_name, aConference[prop_name]);
         }
         query.bindValue(":start", QDateTime(QDate::fromString(aConference["start"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t());
@@ -147,10 +147,10 @@ void SqlEngine::addConferenceToDB(QHash<QString,QString> &aConference, int confe
     }
     else // update conference
     {
-        query.prepare("UPDATE CONFERENCE set title=:title, url=:url, subtitle=:subtitle, venue=:venue, city=:city, start=:start, end=:end, days=:days,"
+        query.prepare("UPDATE CONFERENCE set title=:title, url=:url, subtitle=:subtitle, venue=:venue, city=:city, start=:start, end=:end,"
                                             "day_change=:day_change, timeslot_duration=:timeslot_duration, active=:active "
                       "WHERE id=:id");
-        foreach (QString prop_name, (QList<QString>() << "title" << "url" << "subtitle" << "venue" << "city" << "days")) {
+        foreach (QString prop_name, (QList<QString>() << "title" << "url" << "subtitle" << "venue" << "city")) {
             query.bindValue(QString(":") + prop_name, aConference[prop_name]);
         }
         query.bindValue(":start", QDateTime(QDate::fromString(aConference["start"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t());