implement deleting a conference
[toast/confclerk.git] / src / sql / schedulexmlparser.cpp
index c1c6559..fb869ae 100644 (file)
@@ -30,13 +30,15 @@ ScheduleXmlParser::ScheduleXmlParser(QObject *aParent)
 {
 }
 
-int ScheduleXmlParser::parseData(const QByteArray &aData)
+int ScheduleXmlParser::parseData(const QByteArray &aData, const QString& url)
 {
     QDomDocument document;
     document.setContent (aData, false);
 
     QDomElement scheduleElement = document.firstChildElement("schedule");
 
+    SqlEngine::beginTransaction();
+
     int confId = 0;
     if (!scheduleElement.isNull())
     {
@@ -54,6 +56,7 @@ int ScheduleXmlParser::parseData(const QByteArray &aData)
             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;
             SqlEngine::addConferenceToDB(conference);
             confId = conference["id"].toInt();
             emit(parsingSchedule(conference["title"]));
@@ -144,6 +147,7 @@ int ScheduleXmlParser::parseData(const QByteArray &aData)
             } // parsing room elements
         } // parsing day elements
     } // schedule element
+    SqlEngine::commitTransaction();
 
     return confId;
 }