Changeset 5d9409d for src


Ignore:
Timestamp:
03/03/10 16:47:00 (12 years ago)
Author:
timkoma <timkoma@…>
Branches:
master, qt5
Children:
5bd6aba
Parents:
7270ae0
Message:

UTC/LocalTime fix for import conference XML, DB queries for multiple conferences fixes

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/alarm/alarm.cpp

    r7270ae0 r5d9409d  
    4848    local.setTimeSpec(Qt::LocalTime);
    4949    qDebug() << "LocalTime: " << local.toTime_t();
    50    
     50
    5151    eve->alarm_time = local.toTime_t();
    5252    eve->flags = ALARM_EVENT_BOOT;
  • src/mvc/event.cpp

    r7270ae0 r5d9409d  
    144144    {
    145145        QSqlQuery query;
    146         query.prepare("SELECT xid_room FROM event_room WHERE xid_event = :id");
     146        query.prepare("SELECT xid_room FROM event_room WHERE xid_event = :id AND xid_conference = :conf");
    147147        query.bindValue(":id", id());
     148        query.bindValue(":conf", conferenceId());
    148149        if (!query.isActive())
    149150            if (!query.exec())
     
    165166        QSqlQuery query;
    166167        // TODO: conference ID isn't used here
    167         query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id");
     168        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");
    168169        query.bindValue(":id", id());
     170        query.bindValue(":conf", conferenceId());
    169171        query.exec();
    170172        // TODO: handle qeury error
  • src/sql/sqlengine.cpp

    r7270ae0 r5d9409d  
    153153            /*qDebug() << QString("DEBUG: Track %1 added to DB").arg(name);*/
    154154        }
    155         QDateTime startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT));
     155        QDateTime startDateTime;
     156        startDateTime.setTimeSpec(Qt::UTC);
     157        startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT),Qt::UTC);
     158        qDebug() << "startDateTime: " << startDateTime.toString();
    156159        QString values = QString("'%1', '%2', '%3', '%4', '%5', '%6', '%7', ? , ? , ? , ? , ? , '%8', '%9'") \
    157160                         .arg(aEvent["conference_id"]) \
     
    169172            .arg(values);
    170173
     174        qDebug() << query;
    171175        QSqlQuery result;
    172176        result.prepare(query);
     
    369373    execQuery( db, query );
    370374
    371     //TODO: retun number of rows from SEARCH_EVENT
    372375    return 1;
    373376}
Note: See TracChangeset for help on using the changeset viewer.