photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerupload.cpp
changeset 2 7d9067c6fcb1
parent 0 4e91876724a2
child 18 bcb43dc84c44
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerupload.cpp	Thu Jan 07 12:46:23 2010 +0200
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerupload.cpp	Mon Jan 18 20:19:20 2010 +0200
@@ -53,11 +53,6 @@
     const TUid KCmdGetOneClickToolTip = { 15 };    
     }
 
-// Get the AppUi instance
-// This class does not have access to a CEikonEnv and hence 
-// pls ignore the code scanner warning - Using CEikonEnv::Static
-#define GetAppUi() (dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi()))
-
 // ----------------------------------------------------------------------------
 // Two-phased constructor.
 // ----------------------------------------------------------------------------
@@ -370,47 +365,48 @@
 void CGlxCommandHandlerUpload::SetToolTipL()
     {
     TRACER("CGlxCommandHandlerUpload::SetToolTipL");
-    
-    CAknToolbar* toolbar = GetAppUi()->CurrentFixedToolbar();
 
-    if(toolbar)
+    CAknToolbar* toolbar = iAvkonAppUi->CurrentFixedToolbar();
+    if (!toolbar)
         {
-        CAknButton* uploadButton = static_cast<CAknButton*>     
-        (toolbar->ControlOrNull( EGlxCmdUpload ));
-                    
-        if(uploadButton && iUploadSupported)
+        return;
+        }
+
+    CAknButton* uploadButton =
+            static_cast<CAknButton*> (toolbar->ControlOrNull(EGlxCmdUpload));
+
+    if (uploadButton && iUploadSupported)
+        {
+        // Get the tooltip text from AIW ShareOnline application
+        HBufC* toolTipText = NULL;
+
+        // GetToolTipL might allocate memory. Hence toolTipText should 
+        // be popped and destroyed if present.
+        GetToolTipL(toolTipText);
+
+        if (toolTipText)
             {
-            // Get the tooltip text from AIW ShareOnline application
-            HBufC* toolTipText = NULL;
-            
-            // GetToolTipL might allocate memory. Hence toolTipText should 
-            // be popped and destroyed if present.
-            GetToolTipL(toolTipText);     
-            
-            if( toolTipText )
-                {                
-                // Get current button state and set the help text(tool tip)             
-                CAknButtonState* currentState = uploadButton->State();
-                
-               TBool dimmed = uploadButton->IsDimmed();
-               if(dimmed)
-               		{
-               		uploadButton->SetDimmed(EFalse);
-                	currentState->SetHelpTextL( toolTipText->Des()); 
-                	uploadButton->SetDimmed(ETrue);
-              		}
-              	else
-              		{
-              		currentState->SetHelpTextL( toolTipText->Des()); 	
-              		}
-                CleanupStack::PopAndDestroy(toolTipText);
+            // Get current button state and set the help text(tool tip)             
+            CAknButtonState* currentState = uploadButton->State();
+
+            TBool dimmed = uploadButton->IsDimmed();
+            if (dimmed)
+                {
+                uploadButton->SetDimmed(EFalse);
+                currentState->SetHelpTextL(toolTipText->Des());
+                uploadButton->SetDimmed(ETrue);
                 }
             else
                 {
-                User::Leave(KErrArgument);
-                }            
+                currentState->SetHelpTextL(toolTipText->Des());
+                }
+            CleanupStack::PopAndDestroy(toolTipText);
             }
-        }
+        else
+            {
+            User::Leave(KErrArgument);
+            }
+        } // if(uploadButton && iUploadSupported)
     }
 
 // End of file