295 CleanupStack::PushL(attributeContext); |
291 CleanupStack::PushL(attributeContext); |
296 attributeContext->AddAttributeL( |
292 attributeContext->AddAttributeL( |
297 KGlxMediaCollectionPluginSpecificDefaultMediaTitle); |
293 KGlxMediaCollectionPluginSpecificDefaultMediaTitle); |
298 rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); |
294 rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); |
299 |
295 |
300 TGlxFetchContextRemover contextRemover(attributeContext, *rootList); |
296 // Media list must not have been deleted when the destructor of |
301 // put to cleanupstack as cleanupstack is emptied before stack objects |
297 // TGlxContextRemover is called while going out-of-scope. |
302 // are deleted |
298 { |
303 CleanupClosePushL(contextRemover); |
299 TGlxFetchContextRemover contextRemover(attributeContext, *rootList); |
304 User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, |
300 // put to cleanupstack as cleanupstack is emptied before stack objects |
305 *rootList, ETrue)); |
301 // are deleted |
306 // context off the list |
302 CleanupClosePushL(contextRemover); |
307 CleanupStack::PopAndDestroy(&contextRemover); |
303 User::LeaveIfError(GlxAttributeRetriever::RetrieveL( |
|
304 *attributeContext, *rootList, ETrue)); |
|
305 // context off the list |
|
306 CleanupStack::PopAndDestroy(&contextRemover); |
|
307 } // Limiting scope of contextRemover |
308 |
308 |
309 TInt index = rootList->Index(KGlxIdSpaceIdRoot, aCollectionId); |
309 TInt index = rootList->Index(KGlxIdSpaceIdRoot, aCollectionId); |
310 |
310 |
311 __ASSERT_DEBUG(index != KErrNotFound, Panic(EGlxPanicRequiredItemNotFound)); |
311 __ASSERT_DEBUG(index != KErrNotFound, Panic(EGlxPanicRequiredItemNotFound)); |
312 |
312 |