mtpdataproviders/mtppictbridgedp/src/cmtppictbridgeenumerator.cpp
branchRCL_3
changeset 3 8b094906a049
parent 0 d0791faffa3f
equal deleted inserted replaced
2:4843bb5893b6 3:8b094906a049
    15 
    15 
    16 
    16 
    17 #include <f32file.h>
    17 #include <f32file.h>
    18 #include <bautils.h>
    18 #include <bautils.h>
    19 #include <s32file.h>
    19 #include <s32file.h>
       
    20 #include <e32std.h>
    20 #include <mtp/mmtpobjectmgr.h>
    21 #include <mtp/mmtpobjectmgr.h>
    21 #include <mtp/cmtpobjectmetadata.h>
    22 #include <mtp/cmtpobjectmetadata.h>
    22 #include <mtp/mmtpdataproviderframework.h>
    23 #include <mtp/mmtpdataproviderframework.h>
    23 #include <mtp/mmtpobjectmgr.h>
    24 #include <mtp/mmtpobjectmgr.h>
    24 #include <mtp/mmtpstoragemgr.h>
    25 #include <mtp/mmtpstoragemgr.h>
   122 		__FLOG_VA((_L16("full path is %S "), &fullPath));
   123 		__FLOG_VA((_L16("full path is %S "), &fullPath));
   123 		iFramework.Fs().SetAtt(fullPath, KEntryAttNormal, KEntryAttReadOnly);
   124 		iFramework.Fs().SetAtt(fullPath, KEntryAttNormal, KEntryAttReadOnly);
   124 		iFramework.Fs().Delete(fullPath);
   125 		iFramework.Fs().Delete(fullPath);
   125 		
   126 		
   126         // enumerate device discovery file (create if not exist)
   127         // enumerate device discovery file (create if not exist)
   127         CMTPTypeFile*    discoveryFile;
   128 
       
   129         RFile rf;
       
   130         CleanupClosePushL(rf);
   128         fullPath = PathInfo::PhoneMemoryRootPath();
   131         fullPath = PathInfo::PhoneMemoryRootPath();
   129         fullPath.Append(KDeviceDiscovery);
   132         fullPath.Append(KDeviceDiscovery);
   130         __FLOG_VA((_L16("full path is %S "), &fullPath));
   133         __FLOG_VA((_L16("full path is %S "), &fullPath));
   131         iFramework.Fs().SetAtt(fullPath, KEntryAttNormal, KEntryAttReadOnly);
   134         iFramework.Fs().SetAtt(fullPath, KEntryAttNormal, KEntryAttReadOnly);
   132         iFramework.Fs().Delete(fullPath);
   135         iFramework.Fs().Delete(fullPath);
   133         
   136         
   134         discoveryFile = NULL;
   137         rf.Create(iFramework.Fs(), fullPath, EFileWrite);
   135         discoveryFile = CMTPTypeFile::NewLC(iFramework.Fs(), fullPath, EFileWrite);
   138         TTime time;
   136         discoveryFile->SetSizeL(0);
   139         time.HomeTime();
   137         CleanupStack::PopAndDestroy(discoveryFile);
   140         rf.SetModified(time);
       
   141         CleanupStack::PopAndDestroy(&rf);
   138         
   142         
   139         CMTPObjectMetaData* objectP = CMTPObjectMetaData::NewLC(iSingletons.DpController().FileDpId(), EMTPFormatCodeScript, storageId, fullPath);
   143         CMTPObjectMetaData* objectP = CMTPObjectMetaData::NewLC(iSingletons.DpController().FileDpId(), EMTPFormatCodeScript, storageId, fullPath);
   140 
   144 
   141         objectP->SetUint(CMTPObjectMetaData::EParentHandle, KMTPHandleNoParent);
   145         objectP->SetUint(CMTPObjectMetaData::EParentHandle, KMTPHandleNoParent);
   142 	    objectMgr.InsertObjectL(*objectP);
   146 	    objectMgr.InsertObjectL(*objectP);