qtmobility/plugins/contacts/symbian/src/filtering/cntfilteraction.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
    58 
    58 
    59 QList<QContactLocalId> CntFilterAction::contacts(
    59 QList<QContactLocalId> CntFilterAction::contacts(
    60         const QContactFilter &filter,
    60         const QContactFilter &filter,
    61         const QList<QContactSortOrder> &sortOrders,
    61         const QList<QContactSortOrder> &sortOrders,
    62         bool &filterSupportedflag,
    62         bool &filterSupportedflag,
    63         QContactManager::Error &error)  
    63         QContactManager::Error* error)
    64 {
    64 {
    65     Q_UNUSED(sortOrders);
    65     Q_UNUSED(sortOrders);
    66     Q_UNUSED(filterSupportedflag);
    66     Q_UNUSED(filterSupportedflag);
    67     //Check if any invalid filter is passed 
    67     //Check if any invalid filter is passed 
    68     if(!filterSupported(filter))
    68     if(!filterSupported(filter))
    69             {
    69             {
    70             error =  QContactManager::NotSupportedError;
    70             *error =  QContactManager::NotSupportedError;
    71             return QList<QContactLocalId>();
    71             return QList<QContactLocalId>();
    72             }
    72             }
    73     QList<QContactLocalId> idList;
    73     QList<QContactLocalId> idList;
    74     
    74     
    75     //Create the query
    75     //Create the query
    76     QString sqlQuery;
    76     QString sqlQuery;
    77     createSelectQuery( filter,sqlQuery,error);
    77     createSelectQuery( filter,sqlQuery,error);
    78     
    78     
    79     //fetch the contacts
    79     //fetch the contacts
    80     if(error != QContactManager::NotSupportedError)
    80     if(*error != QContactManager::NotSupportedError)
    81     {
    81     {
    82         idList =  m_srvConnection.searchContacts(sqlQuery, error);
    82         idList =  m_srvConnection.searchContacts(sqlQuery, error);
    83     }
    83     }
    84     
    84     
    85     return idList;
    85     return idList;
   101 }
   101 }
   102 
   102 
   103 
   103 
   104 void CntFilterAction::createSelectQuery(const QContactFilter& filter,
   104 void CntFilterAction::createSelectQuery(const QContactFilter& filter,
   105                               QString& sqlQuery,
   105                               QString& sqlQuery,
   106                               QContactManager::Error& error)
   106                               QContactManager::Error* error)
   107 
   107 
   108 {
   108 {
   109     //Check if any invalid filter is passed 
   109     //Check if any invalid filter is passed 
   110     if(!filterSupported(filter))
   110     if(!filterSupported(filter))
   111             {
   111             {
   112             error =  QContactManager::NotSupportedError;
   112             *error =  QContactManager::NotSupportedError;
   113             }
   113             }
   114    //For default filter, just return the below query
   114    //For default filter, just return the below query
   115     sqlQuery = "";
   115     sqlQuery = "";
   116 
   116 
   117     
   117