]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/eventmodel.cpp
update for the search
[toast/confclerk.git] / src / mvc / eventmodel.cpp
index e497c25fc80c114abab90c883cc15196b1bb6f80..629581563b6e8495047f7aab53b3d1087022d895 100644 (file)
@@ -184,16 +184,28 @@ void EventModel::loadFavEvents(const QDate &aDate, int aConferenceId)
     createTimeGroups();
 }
 
-void EventModel::loadSearchResultEvents(const QDate &aDate, int aConferenceId)
+int EventModel::loadSearchResultEvents(const QDate &aDate, int aConferenceId)
 {
     clearModel();
     // check for existence of the conference in the DB
     if(Conference::getAll().count())
     {
         qDebug() << "Loading search result Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate;
-        mEvents = Event::getSearchResultByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start");
+        try{
+            mEvents = Event::getSearchResultByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start");
+        }
+        catch( OrmException &e  ){
+            qDebug() << "Event::getSearchResultByDate failed: " << e.text();
+        }
+        catch(...){
+            qDebug() << "Event::getSearchResultByDate failed";
+        }
+
     }
+
     createTimeGroups();
+
+    return mEvents.count();
 }
 
 void EventModel::loadEventsByTrack(const QDate &aDate, int aConferenceId)