ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerremovefrom.cpp
changeset 29 2c833fc9e98f
parent 26 c499df2dbb33
child 54 0f0f3f26f787
equal deleted inserted replaced
26:c499df2dbb33 29:2c833fc9e98f
    17 
    17 
    18 #include <mpxcollectionpath.h>
    18 #include <mpxcollectionpath.h>
    19 #include <mglxmedialist.h>
    19 #include <mglxmedialist.h>
    20 #include <glxcommandfactory.h>
    20 #include <glxcommandfactory.h>
    21 #include <glxcommandhandlerremovefrom.h>
    21 #include <glxcommandhandlerremovefrom.h>
       
    22 #include <glxcollectionpluginalbums.hrh>
       
    23 #include <glxcommandhandlers.hrh>
    22 #include "OstTraceDefinitions.h"
    24 #include "OstTraceDefinitions.h"
    23 #ifdef OST_TRACE_COMPILER_IN_USE
    25 #ifdef OST_TRACE_COMPILER_IN_USE
    24 #include "glxcommandhandlerremovefromTraces.h"
    26 #include "glxcommandhandlerremovefromTraces.h"
    25 #endif
    27 #endif
    26 
    28 
    41         MGlxMediaList& aMediaList, TBool& aConsume) const
    43         MGlxMediaList& aMediaList, TBool& aConsume) const
    42     {
    44     {
    43     OstTraceFunctionEntry0( GLXCOMMANDHANDLERREMOVEFROM_CREATECOMMANDL_ENTRY );
    45     OstTraceFunctionEntry0( GLXCOMMANDHANDLERREMOVEFROM_CREATECOMMANDL_ENTRY );
    44     Q_UNUSED(aCommandId);
    46     Q_UNUSED(aCommandId);
    45     Q_UNUSED(aConsume);
    47     Q_UNUSED(aConsume);
       
    48 
       
    49     CMPXCommand* command = NULL;
    46     CMPXCollectionPath* path = aMediaList.PathLC(
    50     CMPXCollectionPath* path = aMediaList.PathLC(
    47             NGlxListDefs::EPathFocusOrSelection);
    51              NGlxListDefs::EPathFocusOrSelection);
       
    52            
       
    53     if(aCommandId == EGlxCmdRemoveFromFav)
       
    54         {
       
    55           // adding to the favourites
       
    56           TGlxMediaId favId(KGlxCollectionFavoritesId);     
       
    57           command = TGlxCommandFactory::RemoveFromContainerCommandLC(favId, *path);
       
    58         }
       
    59     else
       
    60         {
       
    61           command = TGlxCommandFactory::RemoveFromContainerCommandLC(*path);
       
    62         }
    48 
    63 
    49     CMPXCommand* command = TGlxCommandFactory::RemoveFromContainerCommandLC(
       
    50             *path);
       
    51     CleanupStack::Pop(command);
    64     CleanupStack::Pop(command);
    52     CleanupStack::PopAndDestroy(path);
    65     CleanupStack::PopAndDestroy(path);
    53     OstTraceFunctionExit0( GLXCOMMANDHANDLERREMOVEFROM_CREATECOMMANDL_EXIT );
    66     OstTraceFunctionExit0( GLXCOMMANDHANDLERREMOVEFROM_CREATECOMMANDL_EXIT );
    54     return command;
    67     return command;
    55     }
    68     }