Ignore:
Timestamp:
01/20/10 22:02:30 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
8fe9bd2
Parents:
926f106
Message:

changed 'Activity' -> 'Track'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/eventmodel.cpp

    r926f106 r4693fa6  
    11#include "eventmodel.h"
    22#include <conference.h>
    3 #include <activity.h>
    4 
    5 const QString EventModel::COMMA_SEPARATOR = ", ";
     3#include <track.h>
    64
    75EventModel::EventModel()
     
    4644}
    4745
    48 void EventModel::createActivityGroups() {
     46void EventModel::createTrackGroups() {
    4947    mGroups.clear();
    5048    mParents.clear();
     
    5351        return;
    5452    }
    55     int activityId = mEvents.first().activityId();
    56 
    57     mGroups << EventModel::Group(Activity::getActivityName(activityId), 0);
    58     int nextActivityId = activityId;
     53    int trackId = mEvents.first().trackId();
     54
     55    mGroups << EventModel::Group(Track::getTrackName(trackId), 0);
     56    int nextTrackId = trackId;
    5957
    6058    for (int i=0; i<mEvents.count(); i++)
    6159    {
    62         activityId = mEvents.at(i).activityId();
    63         if (nextActivityId != activityId)
     60        trackId = mEvents.at(i).trackId();
     61        if (nextTrackId != trackId)
    6462        {
    6563            mGroups.last().mChildCount = i - mGroups.last().mFirstEventIndex;
    66             mGroups << EventModel::Group(Activity::getActivityName(activityId), i);
    67             nextActivityId = activityId;
     64            mGroups << EventModel::Group(Track::getTrackName(trackId), i);
     65            nextTrackId = trackId;
    6866        }
    6967        // add parent-child relation
     
    168166    {
    169167        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");
    171169    }
    172170    createTimeGroups();
     
    185183}
    186184
    187 void EventModel::loadEventsByActivities(const QDate &aDate, int aConferenceId)
     185void EventModel::loadEventsByTrack(const QDate &aDate, int aConferenceId)
    188186{
    189187    clearModel();
    190188    if(Conference::getAll().count())
    191189    {
    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     createActivityGroups();
     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();
    196194}
    197195
Note: See TracChangeset for help on using the changeset viewer.