Changeset 4693fa6 for src/mvc/eventmodel.cpp
- Timestamp:
- 01/20/10 22:02:30 (13 years ago)
- Branches:
- master, qt5
- Children:
- 8fe9bd2
- Parents:
- 926f106
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mvc/eventmodel.cpp
r926f106 r4693fa6 1 1 #include "eventmodel.h" 2 2 #include <conference.h> 3 #include <activity.h> 4 5 const QString EventModel::COMMA_SEPARATOR = ", "; 3 #include <track.h> 6 4 7 5 EventModel::EventModel() … … 46 44 } 47 45 48 void EventModel::create ActivityGroups() {46 void EventModel::createTrackGroups() { 49 47 mGroups.clear(); 50 48 mParents.clear(); … … 53 51 return; 54 52 } 55 int activityId = mEvents.first().activityId();56 57 mGroups << EventModel::Group( Activity::getActivityName(activityId), 0);58 int next ActivityId = activityId;53 int trackId = mEvents.first().trackId(); 54 55 mGroups << EventModel::Group(Track::getTrackName(trackId), 0); 56 int nextTrackId = trackId; 59 57 60 58 for (int i=0; i<mEvents.count(); i++) 61 59 { 62 activityId = mEvents.at(i).activityId();63 if (next ActivityId != activityId)60 trackId = mEvents.at(i).trackId(); 61 if (nextTrackId != trackId) 64 62 { 65 63 mGroups.last().mChildCount = i - mGroups.last().mFirstEventIndex; 66 mGroups << EventModel::Group( Activity::getActivityName(activityId), i);67 next ActivityId = activityId;64 mGroups << EventModel::Group(Track::getTrackName(trackId), i); 65 nextTrackId = trackId; 68 66 } 69 67 // add parent-child relation … … 168 166 { 169 167 qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate; 170 mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, Event::START);168 mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start"); 171 169 } 172 170 createTimeGroups(); … … 185 183 } 186 184 187 void EventModel::loadEventsBy Activities(const QDate &aDate, int aConferenceId)185 void EventModel::loadEventsByTrack(const QDate &aDate, int aConferenceId) 188 186 { 189 187 clearModel(); 190 188 if(Conference::getAll().count()) 191 189 { 192 qDebug() << "Loading Conference Data (by Activities): [" << Conference::getById(aConferenceId).title() << "] " << aDate;193 mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, Event::XID_ACTIVITY + COMMA_SEPARATOR + Event::START);194 } 195 create ActivityGroups();190 qDebug() << "Loading Conference Data (by Track): [" << Conference::getById(aConferenceId).title() << "] " << aDate; 191 mEvents = Event::getByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "xid_track, start"); 192 } 193 createTrackGroups(); 196 194 } 197 195
Note: See TracChangeset
for help on using the changeset viewer.