Changeset 9d8946b for src/mvc


Ignore:
Timestamp:
01/21/10 15:12:57 (13 years ago)
Author:
timkoma <timkoma@…>
Branches:
master, qt5
Children:
e493054
Parents:
6a807e7
Message:

update for the search

Location:
src/mvc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    r6a807e7 r9d8946b  
    2222Event Event::getById(int id, int conferenceId)
    2323{
    24 
    2524    QSqlQuery query;
    2625    query.prepare(selectQuery() + "WHERE id = :id AND xid_conference = :conf");
  • src/mvc/eventmodel.cpp

    r6a807e7 r9d8946b  
    185185}
    186186
    187 void EventModel::loadSearchResultEvents(const QDate &aDate, int aConferenceId)
     187int EventModel::loadSearchResultEvents(const QDate &aDate, int aConferenceId)
    188188{
    189189    clearModel();
     
    192192    {
    193193        qDebug() << "Loading search result Data: [" << Conference::getById(aConferenceId).title() << "] " << aDate;
    194         mEvents = Event::getSearchResultByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start");
    195     }
     194        try{
     195            mEvents = Event::getSearchResultByDate(QDate(aDate.year(), aDate.month(), aDate.day()), aConferenceId, "start");
     196        }
     197        catch( OrmException &e  ){
     198            qDebug() << "Event::getSearchResultByDate failed: " << e.text();
     199        }
     200        catch(...){
     201            qDebug() << "Event::getSearchResultByDate failed";
     202        }
     203
     204    }
     205
    196206    createTimeGroups();
     207
     208    return mEvents.count();
    197209}
    198210
  • src/mvc/eventmodel.h

    r6a807e7 r9d8946b  
    2020    void loadFavEvents(const QDate &aDate, int aConferenceId); // loads Favourite events from the DB
    2121    void loadEventsByTrack(const QDate &aDate, int aConferenceId); // loads Events grouped by Track from the DB
    22     void loadSearchResultEvents(const QDate &aDate, int aConferenceId);
     22    int loadSearchResultEvents(const QDate &aDate, int aConferenceId);
    2323    // a method to force 'EventModel' emit signal 'dataChanged()'
    2424    // a 'view', eg. 'TreeView' listens for this signal and redraws changed items(indexes)
Note: See TracChangeset for help on using the changeset viewer.