mtpdataproviders/mtppictbridgedp/src/cmtppictbridgeenumerator.cpp
branchRCL_3
changeset 3 8b094906a049
parent 0 d0791faffa3f
--- a/mtpdataproviders/mtppictbridgedp/src/cmtppictbridgeenumerator.cpp	Fri Mar 12 15:46:41 2010 +0200
+++ b/mtpdataproviders/mtppictbridgedp/src/cmtppictbridgeenumerator.cpp	Mon Mar 15 12:43:12 2010 +0200
@@ -17,6 +17,7 @@
 #include <f32file.h>
 #include <bautils.h>
 #include <s32file.h>
+#include <e32std.h>
 #include <mtp/mmtpobjectmgr.h>
 #include <mtp/cmtpobjectmetadata.h>
 #include <mtp/mmtpdataproviderframework.h>
@@ -124,17 +125,20 @@
 		iFramework.Fs().Delete(fullPath);
 		
         // enumerate device discovery file (create if not exist)
-        CMTPTypeFile*    discoveryFile;
+
+        RFile rf;
+        CleanupClosePushL(rf);
         fullPath = PathInfo::PhoneMemoryRootPath();
         fullPath.Append(KDeviceDiscovery);
         __FLOG_VA((_L16("full path is %S "), &fullPath));
         iFramework.Fs().SetAtt(fullPath, KEntryAttNormal, KEntryAttReadOnly);
         iFramework.Fs().Delete(fullPath);
         
-        discoveryFile = NULL;
-        discoveryFile = CMTPTypeFile::NewLC(iFramework.Fs(), fullPath, EFileWrite);
-        discoveryFile->SetSizeL(0);
-        CleanupStack::PopAndDestroy(discoveryFile);
+        rf.Create(iFramework.Fs(), fullPath, EFileWrite);
+        TTime time;
+        time.HomeTime();
+        rf.SetModified(time);
+        CleanupStack::PopAndDestroy(&rf);
         
         CMTPObjectMetaData* objectP = CMTPObjectMetaData::NewLC(iSingletons.DpController().FileDpId(), EMTPFormatCodeScript, storageId, fullPath);