From 066b41f0f3e6bbc2cefb11500b07a1ee627d5660 Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Mon, 17 Oct 2011 20:50:54 +0000 Subject: [PATCH] Removed unused nowEvent functions. --- src/mvc/event.cpp | 17 ++--------------- src/mvc/event.h | 1 - src/mvc/eventmodel.cpp | 13 +------------ src/mvc/eventmodel.h | 1 - 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/src/mvc/event.cpp b/src/mvc/event.cpp index 76a3443..86968e7 100644 --- a/src/mvc/event.cpp +++ b/src/mvc/event.cpp @@ -77,22 +77,8 @@ QList Event::getByDateAndRoom(const QDate& date, int conferenceId) return load(query); } -QList Event::nowEvents(int conferenceId, QString orderBy) -{ - uint curTime_t = QDateTime(QDate::currentDate(),QTime::currentTime(),Qt::UTC).toTime_t(); - //uint curTime_t = 1265457610; // for testing - QSqlQuery query; - query.prepare(selectQuery() + QString("WHERE xid_conference = :conf AND start <= :now1 AND ( start + duration ) > :now2 ORDER BY %1").arg(orderBy)); - query.bindValue(":conf", conferenceId); - query.bindValue(":now1", convertToDb(curTime_t, QVariant::DateTime)); - query.bindValue(":now2", convertToDb(curTime_t, QVariant::DateTime)); - - return load(query); -} - -QList Event::conflictEvents(int aEventId, int conferenceId) -{ +QList Event::conflictEvents(int aEventId, int conferenceId) { QSqlQuery query; Event event = Event::getById(aEventId,conferenceId); query.prepare(selectQuery() + "WHERE xid_conference = :conf AND ( \ @@ -109,6 +95,7 @@ QList Event::conflictEvents(int aEventId, int conferenceId) return load(query); } + QList Event::getFavByDate(const QDate& date, int conferenceId) { QSqlQuery query; diff --git a/src/mvc/event.h b/src/mvc/event.h index 8b63a29..08c86f0 100644 --- a/src/mvc/event.h +++ b/src/mvc/event.h @@ -46,7 +46,6 @@ public: static QList getByDate(const QDate & date, int conferenceId, QString orderBy); static QList getFavByDate(const QDate & date, int conferenceId); // get Favourities by Date static QList getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy); - static QList nowEvents(int conferenceId, QString orderBy); // get events scheduled NOW static QList getByTrack(int id); static QList getByDateAndRoom(const QDate& date, int conferenceId); static QList conflictEvents(int aEventId, int conferenceId); diff --git a/src/mvc/eventmodel.cpp b/src/mvc/eventmodel.cpp index 280868f..f86b047 100644 --- a/src/mvc/eventmodel.cpp +++ b/src/mvc/eventmodel.cpp @@ -300,19 +300,8 @@ void EventModel::loadEventsByRoom(const QDate &aDate, int aConferenceId) createRoomGroups(); } -void EventModel::loadNowEvents(int aConferenceId) -{ - clearModel(); - // check for existence of the conference in the DB - if(Conference::getAll().count()) - { - mEvents = Event::nowEvents(aConferenceId, "start"); - } - createTimeGroups(); -} -void EventModel::loadConflictEvents(int aEventId, int aConferenceId) -{ +void EventModel::loadConflictEvents(int aEventId, int aConferenceId) { clearModel(); // check for existence of the conference in the DB if(Conference::getAll().count()) diff --git a/src/mvc/eventmodel.h b/src/mvc/eventmodel.h index 49d5dc7..1383d24 100644 --- a/src/mvc/eventmodel.h +++ b/src/mvc/eventmodel.h @@ -39,7 +39,6 @@ public: void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events sorted by Track id and Event start from the DB int loadSearchResultEvents(const QDate &aDate, int aConferenceId); - void loadNowEvents(int aConferenceId); // loads Now events from the DB void loadEventsByRoom(const QDate &aDate, int aConferenceId); void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict void clearModel(); -- 2.39.5