photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp
branchRCL_3
changeset 25 191387a8b767
parent 18 bcb43dc84c44
child 35 420f6808bf21
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp	Wed Apr 14 15:57:24 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp	Tue Apr 27 16:37:53 2010 +0300
@@ -60,7 +60,6 @@
 //
 EXPORT_C CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit()
     {
-    delete iFeatManager;
     delete iServiceHandler;
 
     if (NULL != iImageViewerInstance)
@@ -75,12 +74,20 @@
 //
 void CGlxCommandHandlerAiwEdit::ConstructL()
     {
-    TRAP_IGNORE(
-                {
-                iServiceHandler = CAiwServiceHandler::NewL();
-                iServiceHandler->AttachL( R_GLX_AIW_EDIT_INTEREST );
-                iEditSupported = ETrue;
-                });
+    CFeatureDiscovery* featManager = CFeatureDiscovery::NewL();
+    CleanupStack::PushL(featManager);
+    
+    if(featManager->IsFeatureSupportedL(KFeatureIdFfImageEditor)
+       && featManager->IsFeatureSupportedL(KFeatureIdFfVideoEditor))
+        {
+        TRAP_IGNORE(
+                    {
+                    iServiceHandler = CAiwServiceHandler::NewL();
+                    iServiceHandler->AttachL( R_GLX_AIW_EDIT_INTEREST );
+                    iEditSupported = ETrue;
+                    });
+        }
+    CleanupStack::PopAndDestroy(featManager);
 
     if (iCommandSingleClick)
         {
@@ -93,8 +100,9 @@
         AddCommandL(info);
         }
 
-    iImageViewerInstance = CGlxImageViewerManager::InstanceL();
-    iFeatManager = CFeatureDiscovery::NewL();
+    iImageViewerInstance = CGlxImageViewerManager::InstanceL();   
+    
+    iIsFullScreenMode = IsInFullScreenViewingModeL();
     }
 
 // -----------------------------------------------------------------------------
@@ -123,22 +131,19 @@
 // -----------------------------------------------------------------------------
 //
 void CGlxCommandHandlerAiwEdit::DynInitMenuPaneL(TInt /*aResourceId*/,
-        CEikMenuPane* aMenuPane)
+        CEikMenuPane* aMenuPane, TBool /*aIsBrowseMode*/)
     {
-    MGlxMediaList& mediaList = MediaList();
-    TInt pos;
 
     if (aMenuPane)
         {
+        MGlxMediaList& mediaList = MediaList();
+        TInt pos;
         //If stylus menu is present, hide it for multiple selection
         if (iCommandSingleClick && aMenuPane->MenuItemExists(
                 EGlxCmdAiwSingleClickEdit, pos)
 
                 && (((!mediaList.Count()) || (mediaList.SelectionCount() > 1))
-                        || (!iFeatManager->IsFeatureSupportedL(
-                                KFeatureIdFfImageEditor)
-                                && !iFeatManager->IsFeatureSupportedL(
-                                        KFeatureIdFfVideoEditor))))
+                        || !iEditSupported))
             {
             aMenuPane->SetItemDimmed(EGlxCmdAiwSingleClickEdit, ETrue);
             }
@@ -149,11 +154,8 @@
             // selection is not equal to 1, we should hide Edit menu item 
             if ((iImageViewerInstance->IsPrivate()
                     || (mediaList.SelectionCount() != 1
-                            && !IsInFullScreenViewingModeL()))
-                    || (!iFeatManager->IsFeatureSupportedL(
-                            KFeatureIdFfImageEditor)
-                            && !iFeatManager->IsFeatureSupportedL(
-                                    KFeatureIdFfVideoEditor)))
+                            && !iIsFullScreenMode))
+                    || !iEditSupported)
                 {
                 aMenuPane->SetItemDimmed(EGlxCmdAiwEdit, ETrue);
                 }