- Timestamp:
- 01/13/10 21:51:06 (13 years ago)
- Branches:
- master, qt5
- Children:
- 6a624f7
- Parents:
- 69393c0
- Location:
- src/model
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/model/conference.h
r69393c0 r969a840 24 24 QString venue() const { return value("venue").toString(); } 25 25 QString city() const { return value("city").toString(); } 26 QDate start() const { return value("start").toDate(); } 27 QDate end() const { return value("end").toDate(); } 26 // TODO: there is some problem with converting "Time_t" to QDateTime: had to manually add 1 day 27 // NEEDS TO BE FIXED 28 QDate start() const { return value("start").toDateTime().addDays(1).date(); } 29 QDate end() const { return value("end").toDateTime().addDays(1).date(); } 30 // 28 31 int days() const { return value("days").toInt(); } 29 32 int dayChange() const { return value("day_change").toInt(); } // in seconds from 00:00 -
src/model/eventmodel.cpp
r69393c0 r969a840 4 4 EventModel::EventModel() 5 5 { 6 7 loadEvents(); 6 mEvents.clear(); 8 7 } 9 8 … … 119 118 } 120 119 121 void EventModel::loadEvents( )120 void EventModel::loadEvents(const QDate &aDate, int aConferenceId) 122 121 { 123 122 mEvents.clear(); 124 123 125 mConfId = 1; // current conference selected: we have only one DB so far 126 // check for existence of conference in the DB 124 // check for existence of the conference in the DB 127 125 if(Conference::getAll().count()) 128 126 { 129 mCurrentDate = Conference::getById(mConfId).start(); 130 qDebug() << "Loading Conference Data: [" << Conference::getById(mConfId).title() << "] " << mCurrentDate; 131 mEvents = Event::getByDate(QDate(mCurrentDate.year(), mCurrentDate.month(), mCurrentDate.day()), mConfId); 127 qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate; 128 mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId); 132 129 } 133 mEvents = Event::getByDate(QDate(mCurrentDate.year(), mCurrentDate.month(), mCurrentDate.day()), mConfId);134 130 createTimeGroups(); 135 131 } -
src/model/eventmodel.h
r69393c0 r969a840 15 15 int columnCount ( const QModelIndex & parent = QModelIndex() ) const; 16 16 int rowCount ( const QModelIndex & parent = QModelIndex() ) const; 17 void loadEvents( ); // loads Events from the DB17 void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB 18 18 19 19 private: … … 40 40 QList<Group> mGroups; 41 41 QHash<int, int> mParents; 42 QDate mCurrentDate;43 int mConfId;44 42 }; 45 43
Note: See TracChangeset
for help on using the changeset viewer.