phonebookengines/VirtualPhonebook/VPbkVCardEng/src/CVPbkVCardImporter.cpp
branchRCL_3
changeset 58 d4f567ce2e7c
parent 57 2666d9724c76
child 64 c1e8ba0c2b16
--- a/phonebookengines/VirtualPhonebook/VPbkVCardEng/src/CVPbkVCardImporter.cpp	Thu Jul 15 18:22:55 2010 +0300
+++ b/phonebookengines/VirtualPhonebook/VPbkVCardEng/src/CVPbkVCardImporter.cpp	Thu Aug 19 09:41:07 2010 +0300
@@ -205,19 +205,6 @@
     iObserver = &aObserver;
     }
 
-CParserProperty* CVPbkVCardImporter::GetCurrentProperty()
-    {
-    // Get current property from parser array
-    CParserProperty* property = NULL;
-    TInt elementCount = iParser->ArrayOfProperties( EFalse )->Count();
-    if ( iArrayElementIndex < elementCount ) 
-        {        
-        property = 
-            iParser->ArrayOfProperties( EFalse )->At( iArrayElementIndex );
-        }
-    return property;
-    }
-
 CParserProperty* CVPbkVCardImporter::NextProperty()
     {
     // Get next property from parser array
@@ -346,15 +333,17 @@
          aData.Uid() == TUid::Uid( KVersitPropertyCDesCArrayUid ) )
         {
         const TDesC& value = converter.GetDesCData( aData );
+        // If it is an IMPP field
         if ( aData.FieldType().FieldTypeResId() == R_VPBK_FIELD_TYPE_IMPP )
             {
             TInt pos = value.Find(KColon);
-            if( 0 == pos )
+            if( 0 == pos || KErrNotFound == pos )
                 {
-                // If the service name is NULL and it's a IMPP field, don't save the data.
+                // If the service name or the colon doesn't exist, don't save the data.
                 // e.g.:
                 // (1) If the value is YAHOO:peterpan@yahoo.com, YAHOO is the service name
                 // (2) If the value is :peterpan@yahoo.com, the service name is NULL
+                // (3) If the value is peterpan@yahoo.com, neither the service name and the colon exists
                 isSaved = EFalse;
                 }
             }
@@ -479,13 +468,17 @@
         {
         delete iAddFieldOperation;
         iAddFieldOperation = NULL;
-        StartAsync( ESaveField );
         }    
     if (&aOperation == iAddCntContactFieldOperation)
         {
         delete iAddCntContactFieldOperation;
         iAddCntContactFieldOperation = NULL;
         }
+    // When both operations have completed
+    if ( !iAddFieldOperation && !iAddCntContactFieldOperation )
+        {
+        StartAsync( ESaveField );
+        }
     }
     
 void CVPbkVCardImporter::FieldAddingFailed(