mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp
changeset 33 883e91c086aa
parent 25 48a2e0d8a4ce
child 38 48c22c726cf9
--- a/mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp	Fri Jun 11 14:27:06 2010 +0300
+++ b/mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp	Tue Jul 06 15:13:34 2010 +0300
@@ -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"));
     }