Changeset 0d4ecc2 for src/mvc


Ignore:
Timestamp:
01/25/10 09:02:15 (12 years ago)
Author:
timkoma <timkoma@…>
Branches:
master, qt5
Children:
6dc0dbc
Parents:
e7340e1
Message:

search update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    re7340e1 r0d4ecc2  
    128128    strQuery += QString("WHERE xid_conference = :conf AND start >= :start AND start < :end ORDER BY %1").arg(orderBy);
    129129    qDebug() << strQuery;
     130    QList<Event> list;
    130131    QSqlQuery query;
    131     query.prepare( strQuery );
    132     query.bindValue(":conf", conferenceId);
    133     query.bindValue(":start", convertToDb(date, QVariant::DateTime));
    134     query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime));
     132    try{
     133        if( !query.prepare( strQuery ) ){
     134            qDebug() << "QSqlQuery.prepare error";
     135            throw OrmSqlException( query.lastError().text() );
     136        }
    135137
    136     return load(query);
     138        query.bindValue(":conf", conferenceId);
     139        query.bindValue(":start", convertToDb(date, QVariant::DateTime));
     140        query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime));
     141
     142        list = load(query);
     143    }
     144    catch(OrmException &e)
     145    {
     146        qDebug() << "getSearchResultByDate error: " << e.text();
     147    }
     148    catch(...){
     149        qDebug() << "getSearchResultByDate failed ...";
     150    }
     151    return list;
    137152}
    138153
Note: See TracChangeset for help on using the changeset viewer.