logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp
changeset 4 e52d42f9500c
parent 0 4a5361db8937
child 6 41c0a814d878
--- a/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp	Fri May 14 15:52:41 2010 +0300
+++ b/logsui/logsengine/logssymbianos/tsrc/stubs/qtcontacts_stubs.cpp	Thu May 27 12:51:53 2010 +0300
@@ -97,25 +97,18 @@
 
 }
 
-QList<QContactLocalId> QContactManager::contacts(
-        const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders) const
-{
-    Q_UNUSED(filter)
-    Q_UNUSED(sortOrders)
-    QList<QContactLocalId> list;
-    if ( QString("11112222").endsWith(logsTestNumber) ){
-        list.append( logsTestContactId );
-    }
-    return list;
-}
-
 QList<QContactLocalId> QContactManager::contactIds(
         const QContactFilter& filter, const QList<QContactSortOrder>& sortOrders) const
 {
     Q_UNUSED(filter)
     Q_UNUSED(sortOrders)
     QList<QContactLocalId> list;
-    if ( QString("11112222").endsWith(logsTestNumber) ){
+    QString matchNum = logsTestNumber;
+    // simulate contact API behavior
+    if ( matchNum.length() > 4 && matchNum.startsWith('+') ){
+        matchNum.remove(0,4);
+    }
+    if ( QString("11112222").endsWith(matchNum) ){
         list.append( logsTestContactId );
     }
     return list;
@@ -131,6 +124,16 @@
     return contact;
 }
 
+QContact QContactManager::contact(const QContactLocalId& contactId, const QContactFetchHint& fetchHint) const
+{
+    Q_UNUSED(fetchHint)
+    QContact contact;
+    if ( contactId == logsTestContactId ) {
+        logsTestContactLocalId = logsTestContactId;
+    }
+    return contact;
+}
+
 
 // ----------------------------------------------------------------------------
 // QContactDetailFilter