mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp
branchRCL_3
changeset 32 f85613f12947
parent 23 f5809cfbf6d5
child 40 453dfc402455
--- a/mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp	Wed Jun 09 10:36:33 2010 +0300
+++ b/mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp	Mon Jun 21 16:36:59 2010 +0300
@@ -185,7 +185,7 @@
 	  if ((iDataProviders[index]->DataProviderId() != iDpIdDeviceDp)
 	  	  && (iDataProviders[index]->DataProviderId() != iDpIdProxyDp))
 	    {
-	    iDataProviderIds.Append(iDataProviders[index]->DataProviderId());
+	    iDataProviderIds.AppendL(iDataProviders[index]->DataProviderId());
 	    }
 	  }
 	
@@ -849,29 +849,36 @@
     __FLOG(_L8("EnumerateDataProviderObjectsL - Entry"));
     CMTPDataProvider& dp(DataProviderL(aId));
 
-	if (IsObjectsEnumerationNeededL(dp))
-		{   
-		TBool abnormaldown = ETrue;
-		iSingletons.FrameworkConfig().GetValueL(CMTPFrameworkConfig::EAbnormalDown , abnormaldown);
-		if ( (!abnormaldown) && (dp.DataProviderConfig().BoolValue(MMTPDataProviderConfig::EObjectEnumerationPersistent)))
-			{       
-			// Initialize persistent objects store.
+    if (IsObjectsEnumerationNeededL(dp))
+        {   
+        TBool abnormaldown = ETrue;
+        iSingletons.FrameworkConfig().GetValueL(CMTPFrameworkConfig::EAbnormalDown , abnormaldown);
+        if ( (!abnormaldown) && (dp.DataProviderConfig().BoolValue(MMTPDataProviderConfig::EObjectEnumerationPersistent)))
+            {       
+            // Initialize persistent objects store.
             iSingletons.ObjectMgr().RestorePersistentObjectsL(aId);
-			}
+            }
         else
-        	{
-			// Mark all non-persistent objects.    
-			iSingletons.ObjectMgr().MarkNonPersistentObjectsL(aId,iEnumeratingStorages[0]);
-		    }
-    
-        // Initiate the data provider enumeration sequence.
-        dp.EnumerateObjectsL(iEnumeratingStorages[0]);
-		}
-	else 
-		{
-		//The DP does not need enumeration this time, so just change the state to go on.
-		EnumerationStateChangedL(dp);
-		}
+            {
+            // Mark all non-persistent objects.    
+            iSingletons.ObjectMgr().MarkNonPersistentObjectsL(aId,iEnumeratingStorages[0]);
+            }
+        if ((KMTPStorageAll == iEnumeratingStorages[0]) || (iSingletons.StorageMgr().ValidStorageId(iEnumeratingStorages[0])))
+            {
+            //Only initiate the data provider enumeration sequence for valid storage or all storage
+            dp.EnumerateObjectsL(iEnumeratingStorages[0]);
+            }
+        else
+            {
+            EnumerationStateChangedL(dp);
+            }
+       
+        }
+    else 
+        {
+        //The DP does not need enumeration this time, so just change the state to go on.
+        EnumerationStateChangedL(dp);
+        }
 
     __FLOG(_L8("EnumerateDataProviderObjectsL - Exit"));
     }