Ignore:
Timestamp:
10/17/12 20:49:16 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
908b4ce
Parents:
95257a6
Message:

We added the conferenceId to some alarm related methods (ticket #41).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/conference.cpp

    r95257a6 r8bd618c  
    5252}
    5353
    54 int Conference::activeConference()
    55 {
    56     {
    57         QSqlQuery query("SELECT id FROM conference WHERE active = 1");
    58         query.exec();
    59 
    60         // TODO: change it so that it will select somw existing ID
    61 
    62         if (query.next()) {
    63             return query.record().value("id").toInt();
    64         }
    65     }
    66 
    67     QSqlQuery query2("SELECT id FROM conference ORDER BY id");
    68     if (query2.next()) {
    69         return query2.record().value("id").toInt();
    70     }
    71 
    72     return -1;
     54int Conference::activeConference() {
     55    QSqlQuery query("SELECT id FROM conference ORDER BY active DESC, id LIMIT 1");
     56    if (!query.exec() || !query.first()) return -1;
     57    return query.record().value("id").toInt();
    7358}
    7459
Note: See TracChangeset for help on using the changeset viewer.