qtmobility/plugins/contacts/symbiansim/src/cntsimcontactfetchrequest.cpp
changeset 14 6fbed849b4f4
parent 4 90517678cc4f
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    72 
    72 
    73     // Fetch all contacts and filter the results.
    73     // Fetch all contacts and filter the results.
    74     // Contacts are fetched starting from index 1, all slots are read
    74     // Contacts are fetched starting from index 1, all slots are read
    75     // since slots may be not filled in a sequence.
    75     // since slots may be not filled in a sequence.
    76     int index = 1;
    76     int index = 1;
    77     int numSlots = simStore()->storeInfo().iTotalEntries;
    77     int numSlots = simStore()->storeInfo().m_totalEntries;
    78     
    78     
    79     if (lidFilter.ids().count() == 1) {
    79     if (lidFilter.ids().count() == 1) {
    80         // Optimization for performance. Fetch a single contact from store.
    80         // Optimization for performance. Fetch a single contact from store.
    81         // This is mainly for CntSymbianSimEngine::contact().
    81         // This is mainly for CntSymbianSimEngine::contact().
    82         index = lidFilter.ids().at(0);
    82         index = lidFilter.ids().at(0);
   106     }
   106     }
   107     
   107     
   108     // Filter & sort results
   108     // Filter & sort results
   109     QList<QContact> filteredAndSorted;
   109     QList<QContact> filteredAndSorted;
   110     for (int i=0; i<contacts.count(); i++) {
   110     for (int i=0; i<contacts.count(); i++) {
   111         if (QContactManagerEngine::testFilter(r->filter(), contacts.at(i)))
   111         if (engine()->filter(r->filter(), contacts.at(i)))
   112             QContactManagerEngine::addSorted(&filteredAndSorted, contacts.at(i), r->sorting());
   112             QContactManagerEngine::addSorted(&filteredAndSorted, contacts.at(i), r->sorting());
   113     }
   113     }
   114 
   114 
   115     // Complete the request
   115     // Complete the request
   116     QContactManagerEngine::updateContactFetchRequest(r, filteredAndSorted, error, QContactAbstractRequest::FinishedState);
   116     QContactManagerEngine::updateContactFetchRequest(r, filteredAndSorted, error, QContactAbstractRequest::FinishedState);