photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp
branchRCL_3
changeset 64 34937ec34dac
parent 60 5b3385a43d68
child 75 01504893d9cb
equal deleted inserted replaced
60:5b3385a43d68 64:34937ec34dac
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:    Delete command handler
    14 * Description:    New media command handler
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 
       
    21 /**
       
    22  * @internal reviewed 06/06/2007 by Dave Schofield
       
    23  */
       
    24 
    20 
    25 #include "glxcommandhandlernewmedia.h"
    21 #include "glxcommandhandlernewmedia.h"
    26 
    22 
    27 #include <AknUtils.h>
    23 #include <AknUtils.h>
    28 #include <badesca.h>
    24 #include <badesca.h>
   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