Changeset e6ab8a2 for src/sql


Ignore:
Timestamp:
07/04/11 23:42:02 (11 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
526128c
Parents:
8dd3dd2
Message:

Removed the ability to show "pictures" (maps) of rooms and maps of conferences.
The XML file does not contain picture/map/image information of conferences or rooms.
We left the room.picture definition in the database SQL because there is no "drop column"
in sqlite.

Location:
src/sql
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sql/schedulexmlparser.cpp

    r8dd3dd2 re6ab8a2  
    104104                        room["event_id"] = eventElement.attribute("id");
    105105                        room["conference_id"] = QString::number(confId,10);
    106                         room["picture"] = ""; // TODO: implement some mapping to assign correct picture to specified room_name
    107106                        SqlEngine::addRoomToDB(room);
    108107
  • src/sql/sqlengine.cpp

    r8dd3dd2 re6ab8a2  
    6767        database.open();
    6868    }
    69 
    70     checkConferenceMap(database);
    7169
    7270    //LOG_INFO(QString("Opening '%1' database '%2'").arg(aDatabaseType).arg(aDatabaseName));
     
    257255        {
    258256            query = QSqlQuery(db);
    259             query.prepare("INSERT INTO ROOM (xid_conference,name,picture) VALUES (:xid_conference, :name, :picture)");
     257            query.prepare("INSERT INTO ROOM (xid_conference,name,picture) VALUES (:xid_conference, :name, '')");
    260258            query.bindValue(":xid_conference", aRoom["conference_id"]);
    261259            query.bindValue(":xid_name", aRoom["name"]);
    262             query.bindValue(":xid_picture", aRoom["picture"]);
    263260            if (!query.exec()) qDebug() << "Could not execute 'insert into room ...' query." << query.lastError();
    264261            aRoom["id"]= query.lastInsertId().toString(); // 'id' is assigned automatically
     
    402399    return true;
    403400}
    404 
    405 void SqlEngine::checkConferenceMap(QSqlDatabase &aDatabase)
    406 {
    407     QSqlQuery sqlQuery(aDatabase);
    408     sqlQuery.prepare("SELECT map FROM conference");
    409     if (!sqlQuery.exec()) {
    410         qWarning() << "column conference.map is missing; adding";
    411         execQuery(aDatabase, "ALTER TABLE conference ADD COLUMN map VARCHAR");
    412     }
    413 }
  • src/sql/sqlengine.h

    r8dd3dd2 re6ab8a2  
    4949        static bool execQuery(QSqlDatabase &aDatabase, const QString &aQuery);
    5050        static bool execQueryWithParameter(QSqlDatabase &aDatabase, const QString &aQuery, const QHash<QString, QVariant>& params);
    51 
    52         static void checkConferenceMap(QSqlDatabase &aDatabase);
    5351};
    5452
Note: See TracChangeset for help on using the changeset viewer.