mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevicedp.cpp
branchRCL_3
changeset 48 debf68073f2f
parent 40 453dfc402455
child 58 142dacf7b30e
--- a/mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevicedp.cpp	Tue Sep 14 22:52:29 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/devdp/src/cmtpdevicedp.cpp	Wed Sep 15 13:07:27 2010 +0300
@@ -416,7 +416,14 @@
     TInt lengthOfRight( folderRight.Length());
     TFileName folderLeft;
     
-    _LIT( KRootFolder, "?:\\");
+    // get root path of storage
+    TInt driveNumber;
+    User::LeaveIfError(Framework().Fs().CharToDrive(folderRight[0], driveNumber));
+    RBuf rootDirPath;
+    rootDirPath.CreateL(KMaxFileName);
+    rootDirPath.CleanupClosePushL();
+    iDevDpSingletons.ConfigMgr().GetRootDirPathL(driveNumber, rootDirPath);
+    rootDirPath.Insert(0, folderRight.Mid(0, 2));// get drive:
     
     /*
     Go through from beginning.
@@ -434,7 +441,7 @@
         lengthOfRight = folderRight.Length()-pos -1;
         folderRight.Set( folderRight.Right( lengthOfRight ));
         
-        if ( KErrNotFound != folderLeft.Match( KRootFolder ))
+        if ( rootDirPath.FindF(folderLeft) != KErrNotFound)
         	{
         	//first time, root folder
         	//continue
@@ -444,7 +451,7 @@
         handle = Framework().ObjectMgr().HandleL( folderLeft );
         }
     while( KMTPHandleNone != handle );
-    
+    CleanupStack::PopAndDestroy(&rootDirPath);
 
     if ( KMTPHandleNone == handle )
         {