photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp
branchRCL_3
changeset 14 ce1c7ad1f18b
parent 13 71da52165949
child 18 bcb43dc84c44
--- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp	Fri Mar 12 15:42:44 2010 +0200
+++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp	Mon Mar 15 12:40:30 2010 +0200
@@ -103,6 +103,12 @@
 
 	{
 	TRACER("GLX_CLOUD::CGlxCloudViewImp::ConstructL");
+	TInt err = iHarvesterClient.Connect();
+    GLX_LOG_INFO1("iHarvesterClient.Connect() err = %d",err);
+    if(err == KErrNone)
+        {
+        iHarvesterClient.AddHarvesterEventObserver(*this, EHEObserverTypeMMC, 1000);
+        }
 	TFileName resourceFile(KDC_APP_RESOURCE_DIR);
 	resourceFile.Append (aFileName);
 	CGlxResourceUtilities::GetResourceFilenameL (resourceFile);
@@ -132,13 +138,13 @@
 CGlxCloudViewImp::~CGlxCloudViewImp()
     {
     TRACER("GLX_CLOUD::CGlxCloudViewImp::~CGlxCloudViewImp");
+    iHarvesterClient.Close();
     CleanupVisuals ();
     delete iEmptyListText;
     if ( iResourceOffset )
         {
         CCoeEnv::Static()->DeleteResourceFile (iResourceOffset);
-        }
-    delete iTitletext;
+        }    
     }
 
 // ---------------------------------------------------------------------------
@@ -192,7 +198,11 @@
 void CGlxCloudViewImp::DoMLViewActivateL(const TVwsViewId & /* aPrevViewId */,
 		TUid /* aCustomMessageId */, const TDesC8 & /* aCustomMessage */)
     {
-    TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewActivateL");   
+    TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewActivateL");
+    if(StatusPane())
+        {
+        StatusPane()->MakeVisible(ETrue);
+        }
     ConstructCloudControlL();
     GLX_LOG_INFO("CGlxCloudViewImp::DoMLViewActivateL Cloud View Control Created" );  
     // set app state to tag-browser view
@@ -207,18 +217,6 @@
 void CGlxCloudViewImp::DoMLViewDeactivate()
 	{
 	TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewDeactivate");
-	if(StatusPane())
-        {
-        if(iTitletext)
-           {
-           delete iTitletext;
-           iTitletext = NULL;
-           }
-        CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
-        TRAP_IGNORE(CAknTitlePane* titlePane = ( CAknTitlePane* )statusPane->ControlL(
-                TUid::Uid( EEikStatusPaneUidTitle ));        
-        iTitletext = titlePane->Text()->AllocL());
-        }
 	//Hide softkeys and toolbar upon view de-activation.
 	iViewWidget->enableControlPane(EFalse);
 	if ( EGlxNavigationForwards == iUiUtility->ViewNavigationDirection() )
@@ -432,3 +430,19 @@
         iCloudControl->ShowContextItemMenu(EFalse);
         }
     }
+// ---------------------------------------------------------------------------
+// HarvestingUpdated
+// 
+// ---------------------------------------------------------------------------
+//
+void CGlxCloudViewImp::HarvestingUpdated( 
+                HarvesterEventObserverType HarvestingUpdated, 
+                HarvesterEventState /*aHarvesterEventState*/,
+                TInt /*aItemsLeft*/ )
+    {
+    TRACER("CGlxCloudViewImp::HarvestingUpdated()");
+    if(HarvestingUpdated == EHEObserverTypeMMC)
+        {
+        ProcessCommandL(EAknSoftkeyClose);
+        }
+    }