mtpdataproviders/mtpfileandfolderdp/src/cmtpfiledp.cpp
changeset 17 aabe5387f5ce
parent 0 d0791faffa3f
child 14 60a94a45d437
--- a/mtpdataproviders/mtpfileandfolderdp/src/cmtpfiledp.cpp	Tue Feb 02 01:11:40 2010 +0200
+++ b/mtpdataproviders/mtpfileandfolderdp/src/cmtpfiledp.cpp	Fri Mar 19 09:40:39 2010 +0200
@@ -28,6 +28,7 @@
 #include "mtpfiledpconst.h"
 #include "mtpfiledppanic.h"
 #include "mtpfiledpprocessor.h"
+#include "cmtpdataprovidercontroller.h"
 
 // Class constants
 static const TInt KArrayGranularity = 3;
@@ -63,6 +64,7 @@
     iActiveProcessors.Close();
     iDpSingletons.Close();
 	iFileDPSingletons.Close();
+	iSingletons.Close();
     delete iFileEnumerator;
     delete iExclusionMgr;
     __FLOG(_L8("~CMTPFileDataProvider - Exit"));
@@ -135,12 +137,12 @@
     {
     __FLOG(_L8("StartObjectEnumerationL - Entry"));
 
-    iExclusionMgr->AppendFormatExclusionListL();
-    iDpSingletons.MTPUtility().FormatExtensionMapping();
     iPendingEnumerations.AppendL(aStorageId);
     if (iPendingEnumerations.Count() == 1)
         {
-        iFileEnumerator->StartL(iPendingEnumerations[KActiveEnumeration]);
+		CMTPDataProviderController& dpController(iSingletons.DpController());
+		TBool bOnlyScanRoot = ( (dpController.EnumerateState() == CMTPDataProviderController::EEnumeratingFrameworkObjects) && (dpController.NeedEnumeratingPhase2()) );
+		iFileEnumerator->StartL(iPendingEnumerations[KActiveEnumeration], bOnlyScanRoot);
         }
     __FLOG(_L8("StartObjectEnumerationL - Exit"));
     }
@@ -148,6 +150,8 @@
 void CMTPFileDataProvider::StartStorageEnumerationL()
     {
     __FLOG(_L8("StartStorageEnumerationL - Entry"));
+    iExclusionMgr->AppendFormatExclusionListL();
+    iDpSingletons.MTPUtility().FormatExtensionMapping();
     Framework().StorageEnumerationCompleteL();
     __FLOG(_L8("StartStorageEnumerationL - Exit"));
     }
@@ -220,7 +224,9 @@
     iPendingEnumerations.Remove(KActiveEnumeration);
     if (iPendingEnumerations.Count())
         {
-        iFileEnumerator->StartL(iPendingEnumerations[KActiveEnumeration]);
+		CMTPDataProviderController& dpController(iSingletons.DpController());
+		TBool bOnlyScanRoot = ( (dpController.EnumerateState() == CMTPDataProviderController::EEnumeratingFrameworkObjects) && (dpController.NeedEnumeratingPhase2()) );
+        iFileEnumerator->StartL(iPendingEnumerations[KActiveEnumeration], bOnlyScanRoot);
         }
     __FLOG(_L8("HandleEnumerationCompletedL - Exit"));
     }
@@ -246,6 +252,7 @@
     __FLOG(_L8("ConstructL - Entry"));
   	iDpSingletons.OpenL(Framework());
   	iFileDPSingletons.OpenL(Framework());
+  	iSingletons.OpenL();
   	
   	iExclusionMgr = CMTPFileDpExclusionMgr::NewL(Framework());
   	iDpSingletons.SetExclusionMgrL(*iExclusionMgr);