diff -r aabe5387f5ce -r 1b39655331a3 mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp --- a/mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp Fri Mar 19 09:40:39 2010 +0200 +++ b/mtpdataproviders/mtpimagedp/src/cmtpimagedp.cpp Fri Apr 16 15:51:48 2010 +0300 @@ -97,10 +97,7 @@ __FLOG_OPEN(KMTPSubsystem, KComponent); __FLOG(_L8(">> CMTPImageDataProvider::ConstructL")); - iPropertyMgr = CMTPImageDpObjectPropertyMgr::NewL(Framework(), *this); iThumbnailManager = CMTPImageDpThumbnailCreator::NewL(*this); - iMdeObserver = CMTPImageDpMdeObserver::NewL(Framework(), *this); - iMdeObserver->SubscribeForChangeNotificationL(); iNewPicNotifier = CMTPImageDpNewPicturesNotifier::NewL(); //Setup central repository connection @@ -273,16 +270,26 @@ { __FLOG(_L8(">> StartObjectEnumerationL")); + TBool isComplete = ETrue; if (aStorageId == KMTPStorageAll) { /* * framework notify data provider to enumerate * */ + if (iPropertyMgr == NULL) + { + iPropertyMgr = CMTPImageDpObjectPropertyMgr::NewL(Framework(), *this); + isComplete = EFalse; + } + iEnumerated = ETrue; } - NotifyEnumerationCompleteL(aStorageId, KErrNone); + if (isComplete) + { + NotifyEnumerationCompleteL(aStorageId, KErrNone); + } __FLOG(_L8("<< StartObjectEnumerationL")); } @@ -398,20 +405,20 @@ /* * bmp files */ -// _LIT(KFormatExtensionBmp, "0x3804:bmp::3"); -// aStrings.AppendL(KFormatExtensionBmp); + _LIT(KFormatExtensionBmp, "0x3804:bmp::3"); + aStrings.AppendL(KFormatExtensionBmp); /* * gif files */ -// _LIT(KFormatExtensionGif, "0x3807:gif::3"); -// aStrings.AppendL(KFormatExtensionGif); + _LIT(KFormatExtensionGif, "0x3807:gif::3"); + aStrings.AppendL(KFormatExtensionGif); /* * png files */ -// _LIT(KFormatExtensionPng, "0x380B:png::3"); -// aStrings.AppendL(KFormatExtensionPng); + _LIT(KFormatExtensionPng, "0x380B:png::3"); + aStrings.AppendL(KFormatExtensionPng); /* * tif, tiff files @@ -768,3 +775,18 @@ __FLOG(_L8("<< DecreaseNewPictures ")); } + +void CMTPImageDataProvider::HandleMdeSessionCompleteL(TInt aError) + { + __FLOG(_L8(">> HandleMdeSessionComplete")); + + NotifyEnumerationCompleteL(KMTPStorageAll, KErrNone); + if (aError == KErrNone) + { + iMdeObserver = CMTPImageDpMdeObserver::NewL(Framework(), *this); + iMdeObserver->SubscribeForChangeNotificationL(); + } + + __FLOG(_L8("<< HandleMdeSessionComplete ")); + } +