--- 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"));
}