qtcontactsmobility/plugins/contacts/symbian/src/filtering/cntfilterdetail.cpp
changeset 46 efe85016a067
parent 40 b46a585f6909
equal deleted inserted replaced
40:b46a585f6909 46:efe85016a067
   253 }
   253 }
   254 
   254 
   255 QList<QContactLocalId>  CntFilterDetail::HandlePredictiveSearchFilter(const QContactFilter& filter,
   255 QList<QContactLocalId>  CntFilterDetail::HandlePredictiveSearchFilter(const QContactFilter& filter,
   256                                                                       QContactManager::Error* error)
   256                                                                       QContactManager::Error* error)
   257 {
   257 {
   258     QString sqlQuery;
       
   259     
       
   260     if (filter.type() == QContactFilter::ContactDetailFilter) {
   258     if (filter.type() == QContactFilter::ContactDetailFilter) {
   261        const QContactDetailFilter detailFilter(filter);
   259         const QContactDetailFilter detailFilter(filter);
   262        if (detailFilter.matchFlags() == QContactFilter::MatchKeypadCollation) {
   260         if (detailFilter.matchFlags() == QContactFilter::MatchKeypadCollation) {
   263            CntSqlSearch sqlSearch;
       
   264            //convert string to numeric format
       
   265             QString pattern = detailFilter.value().toString();
   261             QString pattern = detailFilter.value().toString();
   266             sqlQuery = sqlSearch.CreatePredictiveSearch(pattern);
   262             if ( detailFilter.detailFieldName() == QContactEmailAddress::FieldEmailAddress ) {
   267             return  m_srvConnection.searchContacts(sqlQuery, error);  
   263                 return  m_srvConnection.searchOnServer(
   268        }
   264                         pattern, CntSymbianSrvConnection::CntPredictiveSearchList, error);
   269        else {
   265             } else {
   270            return QList<QContactLocalId>();
   266                 QString sqlQuery;
   271        }
   267                 CntSqlSearch sqlSearch;
   272     }
   268                 //convert string to numeric format
   273     else {
   269                 sqlQuery = sqlSearch.CreatePredictiveSearch(pattern);
   274         return QList<QContactLocalId>();
   270                 return  m_srvConnection.searchContacts(sqlQuery, error);
   275     }
   271             }
   276 }
   272         }
       
   273     }
       
   274     return QList<QContactLocalId>();
       
   275 }
       
   276 
   277 
   277 
   278 /*
   278 /*
   279  * Creates an sql query to fetch contact item IDs for all the contact items
   279  * Creates an sql query to fetch contact item IDs for all the contact items
   280  * which may contain the specified telephone number in a telephone, fax
   280  * which may contain the specified telephone number in a telephone, fax
   281  * or SMS type field.
   281  * or SMS type field.