Changeset 1dbb3bb for src


Ignore:
Timestamp:
07/23/11 11:25:38 (11 years ago)
Author:
gregor herrmann <gregoa@…>
Branches:
master, qt5
Children:
3b51342
Parents:
274f6dc
Message:

Remove conference/room records unconditionally from EVENT_ROOMS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    r274f6dc r1dbb3bb  
    262262            //LOG_AUTOTEST(query);
    263263        }
    264         // check if event is already there, i.e. room name changed
     264       
     265        // remove previous conference/room records; room names might have changed
    265266        query = QSqlQuery(db);
    266         query.prepare("SELECT * FROM EVENT_ROOM WHERE xid_conference=:conference_id AND xid_event=:event_id");
     267        query.prepare("DELETE FROM EVENT_ROOM WHERE xid_conference=:conference_id AND xid_event=:event_id");
    267268        query.bindValue(":conference_id", aRoom["conference_id"]);
    268269        query.bindValue(":event_id", aRoom["event_id"]);
    269270        if (!query.exec()) qDebug() << "Could not execute SELECT * FROM EVENT_ROOM' query:" << query.lastError();
    270         if(query.next()) // event/conference exists --> delete it
    271         {
    272           query.prepare("DELETE FROM EVENT_ROOM WHERE xid_conference=:conference_id AND xid_event=:event_id");
    273           query.bindValue(":conference_id", aRoom["conference_id"]);
    274           query.bindValue(":event_id", aRoom["event_id"]);
    275           if (!query.exec()) qDebug() << "Could not execute SELECT * FROM EVENT_ROOM' query:" << query.lastError();
    276         }
     271        // and insert new ones
    277272        query = QSqlQuery(db);
    278273        query.prepare("INSERT INTO EVENT_ROOM (xid_conference,xid_event,xid_room) VALUES (:conference_id, :event_id, :room_id)");
Note: See TracChangeset for help on using the changeset viewer.