Changeset f9db452 for src/mvc/event.cpp


Ignore:
Timestamp:
01/19/10 08:44:40 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
b1fc17a
Parents:
446bce4
Message:

map-name to map-path implemented

  • correct map is displayed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    r446bce4 rf9db452  
    7070}
    7171
     72QString Event::room() const
     73{
     74    QSqlQuery query;
     75    query.prepare("SELECT name FROM room WHERE id = (SELECT xid_room FROM event_room WHERE xid_event = :id)");
     76    query.bindValue(":id", id());
     77    query.exec();
     78    // TODO: handle qeury error
     79    //qDebug() << query.lastError();
     80    if(query.next())
     81    {
     82        QString map = query.record().value("name").toString();
     83        map=map.toLower(); // room names are stored in lower-case format
     84        map=map.remove("."); // room names are stored without dots in the name, eg. "aw.1124.png" -> "aw1124.png"
     85        return map;
     86    }
     87    else
     88        return QString("not-available");
     89}
    7290
     91void Event::setRoom(const QString &room)
     92{
     93    qWarning("WARINING: setRoom() is NOT IMPLEMENTED YET");
     94    // TODO: implement
     95}
     96
Note: See TracChangeset for help on using the changeset viewer.