37 ** |
37 ** |
38 ** $QT_END_LICENSE$ |
38 ** $QT_END_LICENSE$ |
39 ** |
39 ** |
40 ****************************************************************************/ |
40 ****************************************************************************/ |
41 |
41 |
42 |
|
43 #include <qtrackercontactidfetchrequest.h> |
42 #include <qtrackercontactidfetchrequest.h> |
44 |
43 |
45 #include <qtcontacts.h> |
44 #include <qtcontacts.h> |
46 #include <qcontactlocalidfetchrequest.h> |
45 #include <qcontactlocalidfetchrequest.h> |
47 #include <qcontactfetchrequest.h> |
46 #include <qcontactfetchrequest.h> |
61 QContactFetchRequest *fetchReq = qobject_cast<QContactFetchRequest*>(req); |
60 QContactFetchRequest *fetchReq = qobject_cast<QContactFetchRequest*>(req); |
62 if( fetchReq && idfetchrequest) |
61 if( fetchReq && idfetchrequest) |
63 { |
62 { |
64 fetchReq->setFilter(idfetchrequest->filter()); |
63 fetchReq->setFilter(idfetchrequest->filter()); |
65 // IMContacts needs to be fetched to use metacontact matching |
64 // IMContacts needs to be fetched to use metacontact matching |
66 fetchReq->setDefinitionRestrictions(QStringList()<<QContactOnlineAccount::DefinitionName); |
65 QContactFetchHint fetchHint; |
|
66 fetchHint.setDetailDefinitionsHint(QStringList() << QContactOnlineAccount::DefinitionName); |
|
67 fetchReq->setFetchHint(fetchHint); |
67 } |
68 } |
68 } |
69 } |
69 |
70 |
70 void QTrackerContactIdFetchRequest::emitFinished() |
71 void QTrackerContactIdFetchRequest::emitFinished(QContactManager::Error error) |
71 { |
72 { |
72 // for now this only serves get all contacts |
73 // for now this only serves get all contacts |
73 QList<QContactLocalId> results; |
74 QList<QContactLocalId> results; |
74 foreach(const QContact &c, result) { |
75 foreach(const QContact &c, result) { |
75 results << c.localId(); |
76 results << c.localId(); |
76 } |
77 } |
77 QContactManagerEngine::updateContactLocalIdFetchRequest(idfetchrequest, results, QContactManager::NoError); |
78 QContactManagerEngine::updateContactLocalIdFetchRequest(idfetchrequest, results, error, QContactAbstractRequest::FinishedState); |
78 QContactManagerEngine::updateRequestState(idfetchrequest, QContactAbstractRequest::FinishedState); |
|
79 } |
79 } |
80 |
80 |