photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp
branchRCL_3
changeset 47 f9e827349359
parent 25 191387a8b767
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp	Wed Jun 09 09:41:51 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerslideshow.cpp	Mon Jun 21 15:40:32 2010 +0300
@@ -341,10 +341,11 @@
                 TInt /*aNewIndex*/, TInt /*aOldIndex*/, MGlxMediaList* aList)
     {
     TRACER("CGlxCommandHandlerSlideshow::HandleFocusChangedL");
-    if (aList->Count() <= 0 && iUiUtility->GetGridToolBar())
+    // Check if toolbar is available.
+    CAknToolbar* toolbar = iUiUtility->GetGridToolBar();
+    if (aList->Count() <= 0 && toolbar)
         {
-        iUiUtility->GetGridToolBar()->SetItemDimmed(
-                EGlxCmdStartMultipleMarking, ETrue, ETrue);
+        toolbar->SetItemDimmed(EGlxCmdSlideshowPlay, ETrue, ETrue);
         }
     }
 
@@ -355,10 +356,12 @@
 void CGlxCommandHandlerSlideshow::HandleItemAddedL(TInt /*aStartIndex*/,
             TInt /*aEndIndex*/, MGlxMediaList* aList)
     {
-    if (aList->Count() > 0 && iUiUtility->GetGridToolBar())
+    TRACER("CGlxCommandHandlerSlideshow::HandleItemAddedL");
+    // Check if toolbar is available.
+    CAknToolbar* toolbar = iUiUtility->GetGridToolBar();
+    if (aList->Count() > 0 && toolbar)
         {
-        iUiUtility->GetGridToolBar()->SetItemDimmed(EGlxCmdSlideshowPlay,
-                EFalse, ETrue);
+        toolbar->SetItemDimmed(EGlxCmdSlideshowPlay, EFalse, ETrue);
         }
     }
 
@@ -378,10 +381,12 @@
 void CGlxCommandHandlerSlideshow::HandleItemRemovedL(TInt /*aStartIndex*/,
             TInt /*aEndIndex*/, MGlxMediaList* aList)
     {
-    if (aList->Count() <= 0 && iUiUtility->GetGridToolBar())
+    TRACER("CGlxCommandHandlerSlideshow::HandleItemRemovedL");
+    // Check if toolbar is available.
+    CAknToolbar* toolbar = iUiUtility->GetGridToolBar();
+    if (aList->Count() <= 0 && toolbar)
         {
-        iUiUtility->GetGridToolBar()->SetItemDimmed(EGlxCmdSlideshowPlay,
-                ETrue, ETrue);
+        toolbar->SetItemDimmed(EGlxCmdSlideshowPlay, ETrue, ETrue);
         }
     }
 
@@ -529,10 +534,11 @@
 void CGlxCommandHandlerSlideshow::HandlePopulatedL( MGlxMediaList* aList )
     {
     TRACER("CGlxCommandHandlerSlideshow::HandlePopulatedL()");
-    if (aList->Count() == 0 && iUiUtility->GetGridToolBar())
+    // Check if toolbar is available.
+    CAknToolbar* toolbar = iUiUtility->GetGridToolBar();
+    if (aList->Count() == 0 && toolbar)
         {
-        iUiUtility->GetGridToolBar()->SetItemDimmed(
-                EGlxCmdSlideshowPlay, ETrue, ETrue);
+        toolbar->SetItemDimmed(EGlxCmdSlideshowPlay, ETrue, ETrue);
         }
     }