mtpdataproviders/mtpimagedp/src/cmtpimagedpobjectpropertymgr.cpp
branchRCL_3
changeset 3 8b094906a049
parent 2 4843bb5893b6
child 6 ef55b168cedb
equal deleted inserted replaced
2:4843bb5893b6 3:8b094906a049
   183 void CMTPImageDpObjectPropertyMgr::ConstructL(MMTPDataProviderFramework& /*aFramework*/)
   183 void CMTPImageDpObjectPropertyMgr::ConstructL(MMTPDataProviderFramework& /*aFramework*/)
   184     {
   184     {
   185     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::ConstructL - Entry"));
   185     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::ConstructL - Entry"));
   186     iPropertiesCache = CMTPImagePropertiesCache::NewL();    
   186     iPropertiesCache = CMTPImagePropertiesCache::NewL();    
   187     iMetaDataSession = CMdESession::NewL(*this);
   187     iMetaDataSession = CMdESession::NewL(*this);
   188     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::ConstructL - Open Mde session"));
       
   189     
       
   190     iActiveSchedulerWait = new (ELeave) CActiveSchedulerWait();
       
   191     iActiveSchedulerWait->Start(); // wait for mdesession to start
       
   192     if (iMdeSessionError != KErrNone) 
       
   193         {
       
   194         User::Leave(iMdeSessionError);
       
   195         }
       
   196     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::ConstructL - Exit"));
   188     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::ConstructL - Exit"));
   197     }
   189     }
   198     
   190     
   199 CMTPImageDpObjectPropertyMgr::~CMTPImageDpObjectPropertyMgr()
   191 CMTPImageDpObjectPropertyMgr::~CMTPImageDpObjectPropertyMgr()
   200     {
   192     {
   201     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::~CMTPImageDpObjectPropertyMgr - Entry"));
   193     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::~CMTPImageDpObjectPropertyMgr - Entry"));
   202     delete iPropertiesCache;
   194     delete iPropertiesCache;
   203     delete iObject;
   195     delete iObject;
   204     delete iMetaDataSession;
   196     delete iMetaDataSession;
   205     delete iActiveSchedulerWait; 
       
   206     delete iThumbnailCache.iThumbnailData;
   197     delete iThumbnailCache.iThumbnailData;
   207     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::~CMTPImageDpObjectPropertyMgr - Exit"));
   198     __FLOG(_L8("CMTPImageDpObjectPropertyMgr::~CMTPImageDpObjectPropertyMgr - Exit"));
   208     __FLOG_CLOSE;
   199     __FLOG_CLOSE;
   209     }
   200     }
   210 
   201 
   955  *  From MMdESessionObserver
   946  *  From MMdESessionObserver
   956  */
   947  */
   957 void CMTPImageDpObjectPropertyMgr::HandleSessionOpened(CMdESession& /*aSession*/, TInt aError)
   948 void CMTPImageDpObjectPropertyMgr::HandleSessionOpened(CMdESession& /*aSession*/, TInt aError)
   958     {   
   949     {   
   959     SetMdeSessionError(aError);
   950     SetMdeSessionError(aError);
   960     if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted())
   951     TRAP_IGNORE(iDataProvider.HandleMdeSessionCompleteL(aError));
   961         {
       
   962         iActiveSchedulerWait->AsyncStop();  
       
   963         }
       
   964     }
   952     }
   965 
   953 
   966 /**
   954 /**
   967  *  From MMdESessionObserver
   955  *  From MMdESessionObserver
   968  */
   956  */
   969 void CMTPImageDpObjectPropertyMgr::HandleSessionError(CMdESession& /*aSession*/, TInt aError)
   957 void CMTPImageDpObjectPropertyMgr::HandleSessionError(CMdESession& /*aSession*/, TInt aError)
   970     {
   958     {
   971     SetMdeSessionError(aError);
   959     SetMdeSessionError(aError);
   972     if (iActiveSchedulerWait && iActiveSchedulerWait->IsStarted())
   960     TRAP_IGNORE(iDataProvider.HandleMdeSessionCompleteL(aError));
   973         {
       
   974         iActiveSchedulerWait->AsyncStop();  
       
   975         }  
       
   976     }
   961     }
   977 
   962 
   978 void CMTPImageDpObjectPropertyMgr::SetMdeSessionError(TInt aError)
   963 void CMTPImageDpObjectPropertyMgr::SetMdeSessionError(TInt aError)
   979     {
   964     {
   980     iMdeSessionError = aError;
   965     iMdeSessionError = aError;