Changeset 4693fa6 for src


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

changed 'Activity' -> 'Track'

Location:
src
Files:
1 added
1 deleted
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r926f106 r4693fa6  
    77#include <schedulexmlparser.h>
    88
    9 #include <activity.h>
     9#include <track.h>
    1010#include <eventmodel.h>
    1111#include <delegate.h>
     
    4040    statusBar()->showMessage(tr("Ready"));
    4141
    42     //update activity map
    43     Activity::updateActivityMap();
     42    //update track map
     43    Track::updateTrackMap();
    4444
    4545    connect(dayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateDayView(const QDate &)));
    46     connect(activityDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateActivitiesDayView(const QDate &)));
    47     connect(favouriteDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateFavouritesDayView(const QDate &)));
     46    connect(trackDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateTracksView(const QDate &)));
     47    connect(favouriteDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateFavouritesView(const QDate &)));
    4848
    4949    // DAY EVENTS View
     
    6464
    6565    //ACTIVITIES View
    66     actTreeView->setHeaderHidden(true);
    67     actTreeView->setRootIsDecorated(false);
    68     actTreeView->setIndentation(0);
    69     actTreeView->setAnimated(true);
    70     actTreeView->setModel(new EventModel());
    71     actTreeView->setItemDelegate(new Delegate(actTreeView));
     66    trackTreeView->setHeaderHidden(true);
     67    trackTreeView->setRootIsDecorated(false);
     68    trackTreeView->setIndentation(0);
     69    trackTreeView->setAnimated(true);
     70    trackTreeView->setModel(new EventModel());
     71    trackTreeView->setItemDelegate(new Delegate(trackTreeView));
    7272
    7373    // DAY EVENTS View
     
    8383    connect(dayTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    8484    connect(favTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    85     connect(actTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
     85    connect(trackTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    8686    connect(searchTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    8787    // request for map to be displayed
    8888    connect(dayTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    8989    connect(favTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    90     connect(actTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     90    connect(trackTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    9191    connect(searchTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    9292    // event search button clicked
     
    103103    {
    104104        dayNavigator->hide(); // hide DayNavigatorWidget
    105         activityDayNavigator->hide();
     105        trackDayNavigator->hide();
    106106    }
    107107    else
     
    110110        QDate aEndDate = Conference::getById(confId).end();
    111111        dayNavigator->setDates(aStartDate, aEndDate);
    112         activityDayNavigator->setDates(aStartDate, aEndDate);
     112        trackDayNavigator->setDates(aStartDate, aEndDate);
    113113        favouriteDayNavigator->setDates(aStartDate, aEndDate);
    114114    }
     
    162162        QDate aEndDate = Conference::getById(confId).end();
    163163        dayNavigator->setDates(aStartDate, aEndDate);
    164         activityDayNavigator->setDates(aStartDate, aEndDate);
    165     }
    166     //update activity map
    167     Activity::updateActivityMap();
     164        trackDayNavigator->setDates(aStartDate, aEndDate);
     165    }
     166    //update track map
     167    Track::updateTrackMap();
    168168}
    169169
     
    207207        }
    208208        break;
    209     case 2: //index 2 of tabWidget: activitiesTab
    210         {
    211             static_cast<EventModel*>(actTreeView->model())->loadEventsByActivities(Conference::getById(confId).start(), confId);
    212             actTreeView->reset();
    213             activityDayNavigator->show();
     209    case 2: //index 2 of tabWidget: trackTab
     210        {
     211            static_cast<EventModel*>(trackTreeView->model())->loadEventsByTrack(Conference::getById(confId).start(), confId);
     212            trackTreeView->reset();
     213            trackDayNavigator->show();
    214214        }
    215215        break;
     
    221221}
    222222
    223 void MainWindow::updateActivitiesDayView(const QDate &aDate)
    224 {
    225     static_cast<EventModel*>(actTreeView->model())->loadEventsByActivities(aDate, confId);
    226     actTreeView->reset();
    227     activityDayNavigator->show();
    228 }
    229 
    230 void MainWindow::updateFavouritesDayView(const QDate &aDate)
     223void MainWindow::updateTracksView(const QDate &aDate)
     224{
     225    static_cast<EventModel*>(trackTreeView->model())->loadEventsByTrack(aDate, confId);
     226    trackTreeView->reset();
     227    trackDayNavigator->show();
     228}
     229
     230void MainWindow::updateFavouritesView(const QDate &aDate)
    231231{
    232232    static_cast<EventModel*>(favTreeView->model())->loadFavEvents(aDate,confId);
  • src/gui/mainwindow.h

    r926f106 r4693fa6  
    2323    void updateDayView(const QDate &aDate);
    2424    void updateTab(const int n);
    25     void updateActivitiesDayView(const QDate &aDate);
    26     void updateFavouritesDayView(const QDate &aDate);
     25    void updateTracksView(const QDate &aDate);
     26    void updateFavouritesView(const QDate &aDate);
    2727    void itemClicked(const QModelIndex &aIndex);
    2828    void displayMap(const QModelIndex &aIndex);
  • src/gui/mainwindow.ui

    r926f106 r4693fa6  
    66    <x>0</x>
    77    <y>0</y>
    8     <width>531</width>
    9     <height>373</height>
     8    <width>609</width>
     9    <height>431</height>
    1010   </rect>
    1111  </property>
     
    6969      <widget class="QWidget" name="activitiesTab" >
    7070       <attribute name="title" >
    71         <string>Activities</string>
     71        <string>Tracks</string>
    7272       </attribute>
    7373       <layout class="QGridLayout" name="gridLayout_4" >
     
    7575         <layout class="QVBoxLayout" name="activitiesVerticalLayout" >
    7676          <item>
    77            <widget class="DayNavigatorWidget" native="1" name="activityDayNavigator" />
    78           </item>
    79           <item>
    80            <widget class="TreeView" name="actTreeView" >
     77           <widget class="DayNavigatorWidget" native="1" name="trackDayNavigator" />
     78          </item>
     79          <item>
     80           <widget class="TreeView" name="trackTreeView" >
    8181            <property name="maximumSize" >
    8282             <size>
     
    9191       </layout>
    9292      </widget>
    93       <widget class="QWidget" name="searchTab">
    94        <attribute name="title">
     93      <widget class="QWidget" name="searchTab" >
     94       <attribute name="title" >
    9595        <string>Search</string>
    9696       </attribute>
    97        <layout class="QVBoxLayout" name="verticalLayout_3">
    98          <item>
    99           <layout class="QFormLayout" name="formLayout">
    100            <property name="fieldGrowthPolicy">
    101             <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
    102            </property>
    103            <item row="0" column="0">
    104             <widget class="QCheckBox" name="searchTitle">
    105              <property name="text">
    106               <string>Title</string>
    107              </property>
    108             </widget>
    109            </item>
    110            <item row="0" column="1">
    111             <layout class="QHBoxLayout" name="horizontalLayout">
    112              <item>
    113               <widget class="QLineEdit" name="searchEdit">
    114                <property name="enabled">
    115                 <bool>true</bool>
    116                </property>
    117                <property name="toolTip">
    118                 <string>type a keyword to search</string>
    119                </property>
    120               </widget>
    121              </item>
    122              <item>
    123               <widget class="QPushButton" name="searchButton">
    124                <property name="text">
    125                 <string>Search</string>
    126                </property>
    127                <property name="checkable">
    128                 <bool>false</bool>
    129                </property>
    130                <property name="autoDefault">
    131                 <bool>false</bool>
    132                </property>
    133                <property name="default">
    134                 <bool>true</bool>
    135                </property>
    136                <property name="flat">
    137                 <bool>false</bool>
    138                </property>
    139               </widget>
    140              </item>
    141             </layout>
    142            </item>
    143            <item row="1" column="0">
    144             <widget class="QCheckBox" name="searchAbstract">
    145              <property name="text">
    146               <string>Abstract</string>
    147              </property>
    148             </widget>
    149            </item>
    150           </layout>
    151          </item>
    152          <item>
    153           <widget class="DayNavigatorWidget" name="searchDayNavigator" native="true">
    154            <property name="maximumSize">
    155             <size>
    156              <width>16777215</width>
    157              <height>16777215</height>
    158             </size>
    159            </property>
    160           </widget>
    161          </item>
    162          <item>
    163           <widget class="TreeView" name="searchTreeView">
    164            <property name="maximumSize">
    165             <size>
    166              <width>16777215</width>
    167              <height>16777215</height>
    168             </size>
    169            </property>
    170           </widget>
    171          </item>
    172         </layout>
    173       </widget>
    174       <widget class="QWidget" name="mapTab">
    175        <attribute name="title">
     97       <layout class="QVBoxLayout" name="verticalLayout_3" >
     98        <item>
     99         <layout class="QFormLayout" name="formLayout" >
     100          <property name="fieldGrowthPolicy" >
     101           <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
     102          </property>
     103          <item row="0" column="0" >
     104           <widget class="QCheckBox" name="searchTitle" >
     105            <property name="text" >
     106             <string>Title</string>
     107            </property>
     108           </widget>
     109          </item>
     110          <item row="0" column="1" >
     111           <layout class="QHBoxLayout" name="horizontalLayout" >
     112            <item>
     113             <widget class="QLineEdit" name="searchEdit" >
     114              <property name="enabled" >
     115               <bool>true</bool>
     116              </property>
     117              <property name="toolTip" >
     118               <string>type a keyword to search</string>
     119              </property>
     120             </widget>
     121            </item>
     122            <item>
     123             <widget class="QPushButton" name="searchButton" >
     124              <property name="text" >
     125               <string>Search</string>
     126              </property>
     127              <property name="checkable" >
     128               <bool>false</bool>
     129              </property>
     130              <property name="autoDefault" >
     131               <bool>false</bool>
     132              </property>
     133              <property name="default" >
     134               <bool>true</bool>
     135              </property>
     136              <property name="flat" >
     137               <bool>false</bool>
     138              </property>
     139             </widget>
     140            </item>
     141           </layout>
     142          </item>
     143          <item row="1" column="0" >
     144           <widget class="QCheckBox" name="searchAbstract" >
     145            <property name="text" >
     146             <string>Abstract</string>
     147            </property>
     148           </widget>
     149          </item>
     150         </layout>
     151        </item>
     152        <item>
     153         <widget class="DayNavigatorWidget" native="1" name="searchDayNavigator" >
     154          <property name="maximumSize" >
     155           <size>
     156            <width>16777215</width>
     157            <height>16777215</height>
     158           </size>
     159          </property>
     160         </widget>
     161        </item>
     162        <item>
     163         <widget class="TreeView" name="searchTreeView" >
     164          <property name="maximumSize" >
     165           <size>
     166            <width>16777215</width>
     167            <height>16777215</height>
     168           </size>
     169          </property>
     170         </widget>
     171        </item>
     172       </layout>
     173      </widget>
     174      <widget class="QWidget" name="mapTab" >
     175       <attribute name="title" >
    176176        <string>Map</string>
    177177       </attribute>
     
    186186     <x>0</x>
    187187     <y>0</y>
    188      <width>531</width>
     188     <width>609</width>
    189189     <height>22</height>
    190190    </rect>
  • src/mvc/delegate.cpp

    r926f106 r4693fa6  
    11#include "delegate.h"
    22#include "eventmodel.h"
    3 #include <activity.h>
     3#include <track.h>
    44
    55#include <QDebug>
     
    6363        QFontMetrics fmBigB(fontBigB);
    6464
    65         int spacer = (fmSmall.boundingRect("999").width() < SPACER) ? SPACER : fmSmall.boundingRect("999").width();
     65        //int spacer = (fmSmall.boundingRect("999").width() < SPACER) ? SPACER : fmSmall.boundingRect("999").width();
    6666
    6767        if(isLast(index))
     
    165165        // track
    166166        titlePointF.setY(titlePointF.y()+fmSmall.height()-fmSmall.descent());
    167         painter->drawText(titlePointF,"Activity(s): " + Activity::getActivityName(event->activityId()));
     167        painter->drawText(titlePointF,"Track: " + Track::getTrackName(event->trackId()));
    168168    }
    169169    else // doesn't have parent - time-groups' elements (top items)
  • src/mvc/event.cpp

    r926f106 r4693fa6  
    88int const Event::sTable1ColCount = 9; // see 'toRecord()' for more details
    99int const Event::sTable2ColCount = 5; // see 'toRecord()' for more details
    10 const QString Event::XID_ACTIVITY = "xid_activity";
    11 const QString Event::START = "start";
    12 
    13 
    1410
    1511QSqlRecord const Event::sColumns = Event::toRecord(QList<QSqlField>()
     
    1915    << QSqlField("start", QVariant::DateTime)
    2016    << QSqlField("duration", QVariant::Int)
    21     << QSqlField("xid_activity", QVariant::Int)
     17    << QSqlField("xid_track", QVariant::Int)
    2218    << QSqlField("type", QVariant::String)
    2319    << QSqlField("language", QVariant::String)
  • src/mvc/event.h

    r926f106 r4693fa6  
    2424    static const int sTable1ColCount;
    2525    static const int sTable2ColCount;
    26     static const QString XID_ACTIVITY;
    27     static const QString START;
    2826public:
    2927    static Event getById(int id, int conferenceId);
     
    3432    int id() const { return value("id").toInt(); }
    3533    int conferenceId() const { return value("xid_conference").toInt(); }
    36     QDateTime start() const { return value(START).toDateTime(); }
     34    QDateTime start() const { return value("start").toDateTime(); }
    3735    int duration() const { return value("duration").toInt(); }
    38     int activityId() const { return value(XID_ACTIVITY).toInt(); }
     36    int trackId() const { return value("xid_track").toInt(); }
    3937    QString type() const { return value("type").toString(); }
    4038    QString language() const { return value("language").toString(); }
     
    5553    void setId(int id) { setValue("id", id); }
    5654    void setConferenceId(int conferenceId) { setValue("xid_conference", conferenceId); }
    57     void setStart(const QDateTime & start) { setValue(START, start); }
     55    void setStart(const QDateTime & start) { setValue("start", start); }
    5856    void setDuration(int duration) { setValue("duration", duration); }
    59     void setActivityId(int activityId) { setValue(XID_ACTIVITY, activityId); }
     57    void setTrackId(int trackId) { setValue("xid_track", trackId); }
    6058    void setType(const QString & type) { setValue("type", type); }
    6159    void setLanguage(const QString & language) { setValue("language", language); }
  • 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
  • src/mvc/eventmodel.h

    r926f106 r4693fa6  
    1919    void loadEvents(const QDate &aDate, int aConferenceId); // loads Events from the DB
    2020    void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
    21     void loadEventsByActivities(const QDate &aDate, int aConferenceId); // loads Events grouped by Activities from the DB
     21    void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events grouped by Track from the DB
    2222    // a method to force 'EventModel' emit signal 'dataChanged()'
    2323    // a 'view', eg. 'TreeView' listens for this signal and redraws changed items(indexes)
     
    4242private:
    4343    void createTimeGroups();
    44     void createActivityGroups();
     44    void createTrackGroups();
    4545    void clearModel();
    4646
  • src/mvc/mvc.pro

    r926f106 r4693fa6  
    1919}
    2020
    21 HEADERS += activity.h \
    22            event.h \
     21HEADERS += event.h \
    2322           conference.h \
     23           track.h \
    2424           delegate.h \
    2525           eventmodel.h \
    2626           treeview.h
    2727
    28 SOURCES += activity.cpp \
    29            event.cpp \
     28SOURCES += event.cpp \
    3029           conference.cpp \
     30           track.cpp \
    3131           delegate.cpp \
    3232           eventmodel.cpp \
  • src/mvc/track.h

    r926f106 r4693fa6  
    11/*
    2  * activity.h
     2 * track.h
    33 *
    44 *  Created on: Dec 27, 2009
     
    66 */
    77
    8 #ifndef ACTIVITY_H_
    9 #define ACTIVITY_H_
     8#ifndef TRACK_H
     9#define TRACK_H
    1010
    1111#include <ormrecord.h>
    1212
    13 class Activity : public OrmRecord<Activity>
     13class Track : public OrmRecord<Track>
    1414{
    1515public:
     
    1818    static const int sTableColCount;
    1919public:
    20     static QMap<int, Activity> mIdToActivity;
     20    static QMap<int, Track> mIdToTrack;
    2121public:
    22     static QList<Activity> getAll();
     22    static QList<Track> getAll();
    2323    int id() const { return value("id").toInt(); }
    2424    void setId(int id) { setValue("id", id); }
     
    2626    void setName(const QString & type) { setValue("name", type); }
    2727public:
    28     static void updateActivityMap();
    29     static QString getActivityName(int id);
     28    static void updateTrackMap();
     29    static QString getTrackName(int id);
    3030};
    3131
    32 #endif /* ACTIVITY_H_ */
     32#endif /* TRACK_H */
     33
  • src/sql/sqlengine.cpp

    r926f106 r4693fa6  
    8787    if (db.isValid() && db.isOpen())
    8888    {
    89         // track/activity has to be handled as the first, since it is necessary to get
    90         // track ID from the ACTIVITY table, or to create new ACTIVITY record
     89        // track has to be handled as the first, since it is necessary to get
     90        // track ID from the TRACK table, or to create new TRACK record
    9191        // and get the ID from newly created record
    92         QString queryExist = QString("SELECT id FROM activity WHERE name='%1'").arg(aEvent["track"]);
     92        QString queryExist = QString("SELECT id FROM track WHERE name='%1'").arg(aEvent["track"]);
    9393        QSqlQuery resultExist(queryExist,db);
    94         // now we have to check whether ACTIVITY record with 'name' exists or not,
    95         // - if it doesn't exist yet, then we have to add that record to 'ACTIVITY' table
    96         //   and assign autoincremented 'id' to aActivity
    97         // - if it exists, then we need to get its 'id' and assign it to aRoom
     94        // now we have to check whether TRACK record with 'name' exists or not,
     95        // - if it doesn't exist yet, then we have to add that record to 'TRACK' table
     96        // - if it exists, then we need to get its 'id'
    9897        int actId = -1;
    99         if(resultExist.next()) // ACTIVITY record with 'name' already exists: we need to get its 'id'
     98        if(resultExist.next()) // TRACK record with 'name' already exists: we need to get its 'id'
    10099        {
    101100            actId = resultExist.value(0).toInt();
    102101        }
    103         else // ACTIVITY record doesn't exist yet, need to create it
     102        else // TRACK record doesn't exist yet, need to create it
    104103        {
    105104            QString values = QString("'%1'").arg(aEvent["track"]);
    106             QString query = QString("INSERT INTO activity (name) VALUES (%1)").arg(values);
     105            QString query = QString("INSERT INTO track (name) VALUES (%1)").arg(values);
    107106            QSqlQuery result (query, db);
    108107            actId = result.lastInsertId().toInt(); // 'id' is assigned automatically
     
    123122                         .arg("0");
    124123
    125         QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_activity, type, language, favourite, alarm) VALUES (%1)").arg(values);
     124        QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_track, type, language, favourite, alarm) VALUES (%1)").arg(values);
    126125        QSqlQuery result (query, db);
    127126        //LOG_AUTOTEST(query);
     
    233232            timeslot_duration INTEGER)");
    234233
    235         query.exec("CREATE TABLE ACTIVITY ( \
     234        query.exec("CREATE TABLE TRACK ( \
    236235            id INTEGER  PRIMARY KEY AUTOINCREMENT  NOT NULL , \
    237236            name VARCHAR NOT NULL )");
     
    251250            start INTEGER NOT NULL , \
    252251            duration INTEGER NOT NULL , \
    253             xid_activity INTEGER NOT NULL REFERENCES ACTIVITY(id), \
     252            xid_track INTEGER NOT NULL REFERENCES TRACK(id), \
    254253            type VARCHAR, \
    255254            language VARCHAR, \
     
    258257            PRIMARY KEY (xid_conference,id), \
    259258            FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id) \
    260             FOREIGN KEY(xid_activity) REFERENCES ACTIVITY(id))");
     259            FOREIGN KEY(xid_track) REFERENCES TRACK(id))");
    261260
    262261#ifdef MAEMO
  • src/test/mvc/eventtest.cpp

    r926f106 r4693fa6  
    2222    QCOMPARE(event.id(), 500);
    2323    QCOMPARE(event.start(), QDateTime(QDate(2009, 2, 7), QTime(11, 30, 0), Qt::UTC));
    24     QCOMPARE(event.activityId(), 123);
     24    QCOMPARE(event.trackId(), 123);
    2525
    2626    // !!! TODO: typeId and languageId
     
    4343    event.setStart(QDateTime::fromString("Sat Feb 7 11:30:00 2009"));
    4444    event.setDuration(30);
    45     event.setActivityId(40);
     45    event.setTrackId(40);
    4646    event.setType(QString("type"));
    4747    event.setLanguage(QString("language"));
     
    5151    QCOMPARE(event.start(), QDateTime::fromString("Sat Feb 7 11:30:00 2009"));
    5252    QCOMPARE(event.duration(), 30);
    53     QCOMPARE(event.activityId(), 40);
     53    QCOMPARE(event.trackId(), 40);
    5454    QCOMPARE(event.type(), QString("type"));
    5555    QCOMPARE(event.language(), QString("language"));
     
    7171void EventTest::columnsForSelect()
    7272{
    73     QCOMPARE(Event::columnsForSelect(), QString("id,xid_conference,start,duration,xid_activity,type,language"));
     73    QCOMPARE(Event::columnsForSelect(), QString("id,xid_conference,start,duration,xid_track,type,language"));
    7474    QCOMPARE(Event::columnsForSelect("t0"),
    75              QString("t0.id,t0.xid_conference,t0.start,t0.duration,t0.xid_activity,t0.type,t0.language"));
     75             QString("t0.id,t0.xid_conference,t0.start,t0.duration,t0.xid_track,t0.type,t0.language"));
    7676}
    7777
    7878void EventTest::selectQuery()
    7979{
    80     QCOMPARE(Event::selectQuery(), QString("SELECT id,xid_conference,start,duration,xid_activity,type,language FROM event "));
     80    QCOMPARE(Event::selectQuery(), QString("SELECT id,xid_conference,start,duration,xid_track,type,language FROM event "));
    8181}
Note: See TracChangeset for help on using the changeset viewer.