mtpfws/mtpfw/dataproviders/devdp/src/cmtpstoragewatcher.cpp
changeset 17 aabe5387f5ce
parent 0 d0791faffa3f
child 47 63cf70d3ecd8
--- a/mtpfws/mtpfw/dataproviders/devdp/src/cmtpstoragewatcher.cpp	Tue Feb 02 01:11:40 2010 +0200
+++ b/mtpfws/mtpfw/dataproviders/devdp/src/cmtpstoragewatcher.cpp	Fri Mar 19 09:40:39 2010 +0200
@@ -24,7 +24,6 @@
 #include "cmtpstoragemgr.h"
 #include "cmtpobjectmgr.h"
 #include "cmtpstoragewatcher.h"
-#include "rmtpdevicedpsingletons.h"
 #include "cmtpdevicedpconfigmgr.h"
 
 
@@ -61,6 +60,7 @@
     iDpSingletons.Close();
     iDrivesExcluded.Close();
     iFrameworkSingletons.Close();
+    iDevDpSingletons.Close();
     __FLOG(_L8("~CMTPStorageWatcher - Exit"));
     __FLOG_CLOSE;
     }
@@ -278,13 +278,10 @@
     iFrameworkSingletons.OpenL();
     iFrameworkSingletons.FrameworkConfig().GetValueL(CMTPFrameworkConfig::ELogicalStorageIdsAllocationEnable, iAllocateLogicalStorages);
     
-    RMTPDeviceDpSingletons devSingletons;
-    devSingletons.OpenL(iFramework);
-    CleanupClosePushL(devSingletons);
-    
     iDpSingletons.OpenL(iFramework);
-    iFolderExclusionList = devSingletons.ConfigMgr().GetArrayValueL(CMTPDeviceDpConfigMgr::EFolderExclusionList); 
-    CleanupStack::PopAndDestroy(&devSingletons);
+    iDevDpSingletons.OpenL(iFramework);
+    iFolderExclusionList = iDevDpSingletons.ConfigMgr().GetArrayValueL(CMTPDeviceDpConfigMgr::EFolderExclusionList); 
+
     __FLOG(_L8("ConstructL - Exit"));
     }
     
@@ -475,6 +472,11 @@
         {
         TMTPNotificationParamsStorageChange params = {physical};
         iFrameworkSingletons.DpController().NotifyDataProvidersL(EMTPStorageAdded, static_cast<TAny*>(&params));
+        
+        if(iFrameworkSingletons.DpController().EnumerateState() == CMTPDataProviderController::EEnumeratingSubDirFiles)
+			{
+			iDevDpSingletons.PendingStorages().InsertInOrder(logical);
+			}
         }
 
     // Notify any connected Initiator(s).
@@ -515,6 +517,12 @@
     TMTPNotificationParamsStorageChange params = {physical};
     iFrameworkSingletons.DpController().NotifyDataProvidersL(EMTPStorageRemoved, static_cast<TAny*>(&params));
 
+    TInt index = iDevDpSingletons.PendingStorages().FindInOrder( logical);
+	if(KErrNotFound != index)
+		{
+		iDevDpSingletons.PendingStorages().Remove(index);
+		}
+        	
     // Notify any connected Initiator(s).
     if (iAllocateLogicalStorages)
         {