Changeset 0bb39f5 for src/mvc/conference.cpp
- Timestamp:
- 01/27/10 16:31:10 (12 years ago)
- Branches:
- master, qt5
- Children:
- a790a90
- Parents:
- 07ae23a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/conference.cpp
r07ae23a r0bb39f5 11 11 << QSqlField("days", QVariant::Int) 12 12 << QSqlField("day_change", QVariant::Int) 13 << QSqlField("timeslot_duration", QVariant::Int)); 13 << QSqlField("timeslot_duration", QVariant::Int) 14 << QSqlField("active", QVariant::Bool)); 14 15 15 16 QString const Conference::sTableName = QString("conference"); … … 30 31 } 31 32 33 int Conference::activeConference() 34 { 35 QSqlQuery query("SELECT id FROM conference WHERE active = 1"); 36 query.exec(); 37 38 QList<int> activeConfs; 39 while(query.next()) 40 activeConfs.append(query.record().value("id").toInt()); 41 42 if(activeConfs.count()==0) // no active DB 43 return 1; 44 else // even if there are more active confs, the first from the list is confidered active 45 return activeConfs[0]; 46 } 47
Note: See TracChangeset
for help on using the changeset viewer.