Changeset d03ca41 in confclerk_git


Ignore:
Timestamp:
09/13/17 23:28:44 (5 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master
Children:
0c71a07
Parents:
7ba0378
git-author:
Philipp Spitzer <philipp@…> (09/13/17 23:26:25)
git-committer:
Philipp Spitzer <philipp@…> (09/13/17 23:28:44)
Message:

If no day_change was given for a conference 4 AM is assumed.

Fixes #53.

Location:
src/sql
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sql/schedulexmlparser.cpp

    r7ba0378 rd03ca41  
    6464            conference["start"] = conferenceElement.firstChildElement("start").text(); // date
    6565            conference["end"] = conferenceElement.firstChildElement("end").text(); // date
    66             conference["day_change"] = conferenceElement.firstChildElement("day_change").text(); // time
     66            QString conferenceDayChangeStr = conferenceElement.firstChildElement("day_change").text(); // time, e.g. "04:00:00"
     67            if (conferenceDayChangeStr.isEmpty()) conferenceDayChangeStr = "04:00:00";
     68            conference["day_change"] = conferenceDayChangeStr;
    6769            conference["timeslot_duration"] = conferenceElement.firstChildElement("timeslot_duration").text(); // time
    6870            conference["url"] = url;
  • src/sql/sqlengine.cpp

    r7ba0378 rd03ca41  
    155155    query.bindValue(":start", QDateTime(QDate::fromString(aConference["start"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t());
    156156    query.bindValue(":end", QDateTime(QDate::fromString(aConference["end"],DATE_FORMAT),QTime(0,0),Qt::UTC).toTime_t());
    157     query.bindValue(":day_change", -QTime::fromString(aConference["day_change"],TIME_FORMAT).secsTo(QTime(0,0)));
     157    QTime dayChange = QTime::fromString(aConference["day_change"].left(TIME_FORMAT.size()), TIME_FORMAT);
     158    query.bindValue(":day_change", QTime(0, 0).secsTo(dayChange));
    158159    query.bindValue(":timeslot_duration", -QTime::fromString(aConference["timeslot_duration"],TIME_FORMAT).secsTo(QTime(0,0)));
    159160    query.bindValue(":active", 1);
Note: See TracChangeset for help on using the changeset viewer.