qtmobility/src/contacts/engines/qcontactmemorybackend.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
child 15 1f895d8a5b2b
--- a/qtmobility/src/contacts/engines/qcontactmemorybackend.cpp	Fri Jun 11 14:26:25 2010 +0300
+++ b/qtmobility/src/contacts/engines/qcontactmemorybackend.cpp	Wed Jun 23 19:08:38 2010 +0300
@@ -293,10 +293,6 @@
 /*! \reimp */
 bool QContactMemoryEngine::saveContacts(QList<QContact>* contacts, QMap<int, QContactManager::Error>* errorMap, QContactManager::Error* error)
 {
-    if(errorMap) {
-        errorMap->clear();
-    }
-
     if (!contacts) {
         *error = QContactManager::BadArgumentError;
         return false;
@@ -309,7 +305,8 @@
         current = contacts->at(i);
         if (!saveContact(&current, changeSet, error)) {
             operationError = *error;
-            errorMap->insert(i, operationError);
+            if (errorMap)
+                errorMap->insert(i, operationError);
         } else {
             (*contacts)[i] = current;
         }
@@ -376,7 +373,8 @@
         current = contactIds.at(i);
         if (!removeContact(current, changeSet, error)) {
             operationError = *error;
-            errorMap->insert(i, operationError);
+            if (errorMap)
+                errorMap->insert(i, operationError);
         }
     }
 
@@ -690,7 +688,7 @@
             QList<QContactSortOrder> sorting = r->sorting();
             QContactFetchHint fetchHint = r->fetchHint();
 
-            QContactManager::Error operationError;
+            QContactManager::Error operationError = QContactManager::NoError;
             QList<QContact> requestedContacts = contacts(filter, sorting, fetchHint, &operationError);
 
             // update the request with the results.