Changeset f09a1b9


Ignore:
Timestamp:
06/23/11 14:13:09 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
a0f3e32
Parents:
141a5c2
Message:

Fixed a bug I introduced when reparing the addRoomToDB function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    r141a5c2 rf09a1b9  
    154154        startDateTime.setTimeSpec(Qt::UTC);
    155155        startDateTime = QDateTime(QDate::fromString(aEvent["date"],DATE_FORMAT),QTime::fromString(aEvent["start"],TIME_FORMAT),Qt::UTC);
    156         qDebug() << "startDateTime: " << startDateTime.toString();
     156        // qDebug() << "startDateTime: " << startDateTime.toString();
    157157
    158158        bool event_exists = false;
     
    248248        if(query.next()) // ROOM record with 'name' already exists: we need to get its 'id'
    249249        {
    250             aRoom["id"] = query.value(0).toInt();
     250            aRoom["id"] = query.value(0).toString();
    251251        }
    252252        else // ROOM record doesn't exist yet, need to create it
     
    258258            query.bindValue(":xid_picture", aRoom["picture"]);
    259259            if (!query.exec()) qDebug() << "Could not execute 'insert into room ...' query." << query.lastError();
    260             aRoom["id"] = query.lastInsertId().toInt(); // 'id' is assigned automatically
     260            aRoom["id"]= query.lastInsertId().toString(); // 'id' is assigned automatically
    261261            //LOG_AUTOTEST(query);
    262262        }
    263263        query = QSqlQuery(db);
    264         query.prepare("INSERT INTO EVENT_ROOM (xid_conference,xid_event,xid_room) VALUES (:conference_id, :event_id, :roomId)");
     264        query.prepare("INSERT INTO EVENT_ROOM (xid_conference,xid_event,xid_room) VALUES (:conference_id, :event_id, :room_id)");
    265265        query.bindValue(":conference_id", aRoom["conference_id"]);
    266266        query.bindValue(":event_id", aRoom["event_id"]);
    267         query.bindValue(":roomId", aRoom["id"]);
     267        query.bindValue(":room_id", aRoom["id"]);
    268268        if (!query.exec()) qDebug() << "Could not 'execute insert into event_room' query:" << query.lastError();
    269269        //LOG_AUTOTEST(query);
Note: See TracChangeset for help on using the changeset viewer.