phonebookui/Phonebook2/ccapplication/ccapp/src/ccapppluginloader.cpp
branchRCL_3
changeset 11 2828b4d142c0
parent 6 e8e3147d53eb
--- a/phonebookui/Phonebook2/ccapplication/ccapp/src/ccapppluginloader.cpp	Tue Apr 27 16:23:35 2010 +0300
+++ b/phonebookui/Phonebook2/ccapplication/ccapp/src/ccapppluginloader.cpp	Tue May 11 16:00:21 2010 +0300
@@ -23,6 +23,7 @@
 #include <mccapluginfactory.h>
 
 #include <cpbk2applicationservices.h>
+#include <CPbk2StoreConfiguration.h>
 #include <CVPbkContactManager.h>
 #include <MVPbkContactStoreProperties.h>
 #include <VPbkContactStoreUris.h>
@@ -131,6 +132,10 @@
     delete iFactoryTempPtr;
     CCA_DP( KCCAppLogFile, CCA_L("<-CCCAppPluginData::~CCCAppPluginLoader"));
     
+    if(iAppServices)
+        {
+        iAppServices->StoreConfiguration().RemoveObserver(*this);
+        }
     Release( iAppServices );
 
     iCommandsResourceFile.Close();
@@ -371,6 +376,7 @@
         KPbk2RomFileDrive, KDC_RESOURCE_FILES_DIR, KPbk2CommonUiDllResFileName );
 
     iAppServices = CPbk2ApplicationServices::InstanceL();
+    iAppServices->StoreConfiguration().AddObserverL(*this);    
     }
 
 // ---------------------------------------------------------------------------
@@ -768,6 +774,7 @@
 void CCCAppPluginLoader::GetPbksXPExtesionNamesL( RArray<TPtrC>& aPbksXPExtesionNamesArray,
         const TDesC& aNameString)
     {
+    CleanupClosePushL( aPbksXPExtesionNamesArray );
     TLex nameString ( aNameString );
     TChar curChar;
     nameString.Mark();
@@ -787,6 +794,7 @@
             nameString.Inc();
             }
         }
+    CleanupStack::Pop();
     }
 
 // ---------------------------------------------------------------------------
@@ -1126,4 +1134,24 @@
         }
     }
 
+// ----------------------------------------------------------------------------
+// CCCAppPluginLoader::ConfigurationChanged
+// ----------------------------------------------------------------------------
+//
+void CCCAppPluginLoader::ConfigurationChanged()
+    {
+    //Special case. Store configuration changed, e.g. store containing current 
+    //contact removed. So close CCA as current contact may not anymore be available
+    CAknAppUi* appUi = static_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
+    TRAP_IGNORE(appUi->HandleCommandL(EAknCmdExit));
+    }
+
+// ----------------------------------------------------------------------------
+// CCCAppPluginLoader::ConfigurationChangedComplete
+// ----------------------------------------------------------------------------
+//
+void CCCAppPluginLoader::ConfigurationChangedComplete()
+    {
+    }
+
 // End of File