- Timestamp:
- 01/22/10 07:18:25 (13 years ago)
- Branches:
- master, qt5
- Children:
- 8b71fb3
- Parents:
- d336730
- Location:
- src/mvc
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/event.cpp
rd336730 rb8a3ad1 36 36 query.bindValue(":start", convertToDb(date, QVariant::DateTime)); 37 37 query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime)); 38 39 return load(query); 40 } 41 42 QList<Event> Event::nowEvents(int conferenceId, QString orderBy) 43 { 44 //uint curTime_t = QDateTime(QDate::currentDate(),QTime::currentTime(),Qt::UTC).toTime_t(); 45 uint curTime_t = 1265457610; // for testing 46 47 QSqlQuery query; 48 query.prepare(selectQuery() + QString("WHERE xid_conference = :conf AND start <= :now1 AND ( start + duration ) > :now2 ORDER BY %1").arg(orderBy)); 49 query.bindValue(":conf", conferenceId); 50 query.bindValue(":now1", convertToDb(curTime_t, QVariant::DateTime)); 51 query.bindValue(":now2", convertToDb(curTime_t, QVariant::DateTime)); 38 52 39 53 return load(query); -
src/mvc/event.h
rd336730 rb8a3ad1 25 25 static QList<Event> getFavByDate(const QDate & date, int conferenceId); // get Favourities by Date 26 26 static QList<Event> getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy); 27 static QList<Event> nowEvents(int conferenceId, QString orderBy); // get events scheduled NOW 27 28 public: 28 29 int id() const { return value("id").toInt(); } -
src/mvc/eventmodel.cpp
rd336730 rb8a3ad1 221 221 } 222 222 223 void EventModel::loadNowEvents(int aConferenceId) 224 { 225 clearModel(); 226 // check for existence of the conference in the DB 227 if(Conference::getAll().count()) 228 { 229 qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] scheduled NOW"; 230 mEvents = Event::nowEvents(aConferenceId, "start"); 231 } 232 createTimeGroups(); 233 } 234 223 235 void EventModel::updateModel(int aEventId) 224 236 { -
src/mvc/eventmodel.h
rd336730 rb8a3ad1 21 21 void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events grouped by Track from the DB 22 22 int loadSearchResultEvents(const QDate &aDate, int aConferenceId); 23 void loadNowEvents(int aConferenceId); // loads Now events from the DB 23 24 24 25 private: -
src/mvc/treeview.cpp
rd336730 rb8a3ad1 133 133 } 134 134 135 void TreeView::setAllExpanded(bool aExpanded) 136 { 137 for(int i=0; i<model()->rowCount(QModelIndex()); i++) 138 { 139 setExpanded(model()->index(i,0,QModelIndex()),aExpanded); 140 } 141 } 142 -
src/mvc/treeview.h
rd336730 rb8a3ad1 13 13 void mouseReleaseEvent(QMouseEvent *aEvent); 14 14 bool testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint); 15 public slots: 16 void setAllExpanded(bool aExpanded); // (aExpanded==true) => expanded; (aExpanded==false) => collapsed 15 17 private slots: 16 18 void handleItemClicked(const QModelIndex &index);
Note: See TracChangeset
for help on using the changeset viewer.