mtpfws/mtpfw/dataproviders/devdp/src/cmtpstoragewatcher.cpp
branchRCL_3
changeset 1 f8e15b44d440
parent 0 d0791faffa3f
equal deleted inserted replaced
0:d0791faffa3f 1:f8e15b44d440
    22 #include "cmtpdataprovidercontroller.h"
    22 #include "cmtpdataprovidercontroller.h"
    23 #include "cmtpframeworkconfig.h"
    23 #include "cmtpframeworkconfig.h"
    24 #include "cmtpstoragemgr.h"
    24 #include "cmtpstoragemgr.h"
    25 #include "cmtpobjectmgr.h"
    25 #include "cmtpobjectmgr.h"
    26 #include "cmtpstoragewatcher.h"
    26 #include "cmtpstoragewatcher.h"
    27 #include "rmtpdevicedpsingletons.h"
       
    28 #include "cmtpdevicedpconfigmgr.h"
    27 #include "cmtpdevicedpconfigmgr.h"
    29 
    28 
    30 
    29 
    31 // Class constants.
    30 // Class constants.
    32 __FLOG_STMT(_LIT8(KComponent,"StorageWatcher");)
    31 __FLOG_STMT(_LIT8(KComponent,"StorageWatcher");)
    59     Cancel();
    58     Cancel();
    60     delete iFolderExclusionList;
    59     delete iFolderExclusionList;
    61     iDpSingletons.Close();
    60     iDpSingletons.Close();
    62     iDrivesExcluded.Close();
    61     iDrivesExcluded.Close();
    63     iFrameworkSingletons.Close();
    62     iFrameworkSingletons.Close();
       
    63     iDevDpSingletons.Close();
    64     __FLOG(_L8("~CMTPStorageWatcher - Exit"));
    64     __FLOG(_L8("~CMTPStorageWatcher - Exit"));
    65     __FLOG_CLOSE;
    65     __FLOG_CLOSE;
    66     }
    66     }
    67     
    67     
    68 void CMTPStorageWatcher::EnumerateStoragesL()
    68 void CMTPStorageWatcher::EnumerateStoragesL()
   276     __FLOG_OPEN(KMTPSubsystem, KComponent);
   276     __FLOG_OPEN(KMTPSubsystem, KComponent);
   277     __FLOG(_L8("ConstructL - Entry"));
   277     __FLOG(_L8("ConstructL - Entry"));
   278     iFrameworkSingletons.OpenL();
   278     iFrameworkSingletons.OpenL();
   279     iFrameworkSingletons.FrameworkConfig().GetValueL(CMTPFrameworkConfig::ELogicalStorageIdsAllocationEnable, iAllocateLogicalStorages);
   279     iFrameworkSingletons.FrameworkConfig().GetValueL(CMTPFrameworkConfig::ELogicalStorageIdsAllocationEnable, iAllocateLogicalStorages);
   280     
   280     
   281     RMTPDeviceDpSingletons devSingletons;
       
   282     devSingletons.OpenL(iFramework);
       
   283     CleanupClosePushL(devSingletons);
       
   284     
       
   285     iDpSingletons.OpenL(iFramework);
   281     iDpSingletons.OpenL(iFramework);
   286     iFolderExclusionList = devSingletons.ConfigMgr().GetArrayValueL(CMTPDeviceDpConfigMgr::EFolderExclusionList); 
   282     iDevDpSingletons.OpenL(iFramework);
   287     CleanupStack::PopAndDestroy(&devSingletons);
   283     iFolderExclusionList = iDevDpSingletons.ConfigMgr().GetArrayValueL(CMTPDeviceDpConfigMgr::EFolderExclusionList); 
       
   284 
   288     __FLOG(_L8("ConstructL - Exit"));
   285     __FLOG(_L8("ConstructL - Exit"));
   289     }
   286     }
   290     
   287     
   291 TUint32 CMTPStorageWatcher::DriveConfigurationL(TBool aAllDrives) const
   288 TUint32 CMTPStorageWatcher::DriveConfigurationL(TBool aAllDrives) const
   292     {
   289     {
   473     // Notify the active data providers.
   470     // Notify the active data providers.
   474     if (iState & EStarted)
   471     if (iState & EStarted)
   475         {
   472         {
   476         TMTPNotificationParamsStorageChange params = {physical};
   473         TMTPNotificationParamsStorageChange params = {physical};
   477         iFrameworkSingletons.DpController().NotifyDataProvidersL(EMTPStorageAdded, static_cast<TAny*>(&params));
   474         iFrameworkSingletons.DpController().NotifyDataProvidersL(EMTPStorageAdded, static_cast<TAny*>(&params));
       
   475         
       
   476         if(iFrameworkSingletons.DpController().EnumerateState() == CMTPDataProviderController::EEnumeratingSubDirFiles)
       
   477 			{
       
   478 			iDevDpSingletons.PendingStorages().InsertInOrder(logical);
       
   479 			}
   478         }
   480         }
   479 
   481 
   480     // Notify any connected Initiator(s).
   482     // Notify any connected Initiator(s).
   481     if (iAllocateLogicalStorages)
   483     if (iAllocateLogicalStorages)
   482         {
   484         {
   513 
   515 
   514     // Notify the active data providers.
   516     // Notify the active data providers.
   515     TMTPNotificationParamsStorageChange params = {physical};
   517     TMTPNotificationParamsStorageChange params = {physical};
   516     iFrameworkSingletons.DpController().NotifyDataProvidersL(EMTPStorageRemoved, static_cast<TAny*>(&params));
   518     iFrameworkSingletons.DpController().NotifyDataProvidersL(EMTPStorageRemoved, static_cast<TAny*>(&params));
   517 
   519 
       
   520     TInt index = iDevDpSingletons.PendingStorages().FindInOrder( logical);
       
   521 	if(KErrNotFound != index)
       
   522 		{
       
   523 		iDevDpSingletons.PendingStorages().Remove(index);
       
   524 		}
       
   525         	
   518     // Notify any connected Initiator(s).
   526     // Notify any connected Initiator(s).
   519     if (iAllocateLogicalStorages)
   527     if (iAllocateLogicalStorages)
   520         {
   528         {
   521         SendEventL(EMTPEventCodeStoreRemoved, logical);
   529         SendEventL(EMTPEventCodeStoreRemoved, logical);
   522         }   
   530         }