calendarui/customisationmanager/src/calencustomisationmanager.cpp
branchRCL_3
changeset 20 9c5b1510919f
parent 0 f979ecb2b13e
child 28 96907930389d
--- a/calendarui/customisationmanager/src/calencustomisationmanager.cpp	Tue May 25 12:41:10 2010 +0300
+++ b/calendarui/customisationmanager/src/calencustomisationmanager.cpp	Wed Jun 09 09:40:23 2010 +0300
@@ -500,20 +500,24 @@
         TInt position = iPlugins.Find( aPlugins[index], CPluginInfo::Identifier );
         if ( position != KErrNotFound ) 
 	        {
-        	if((iInfoBarProviderUid != iPlugins[position]->Uid())
-        		&& (iPreviewPaneProviderUid != iPlugins[ position]->Uid()))
-	            {
-	            CPluginInfo* removedPlugin = iPlugins[ position ];
-	            iPlugins.Remove( position );
-	            delete removedPlugin;
-	            }
-        	else 
-	        	{
-	        	iPlugins[position]->Disable(ETrue);
-				iDefferedUnloadPluginList.AppendL(iPlugins[position]->Uid());
-				iInfoBarProviderUid = KNullUid;
-				iPreviewPaneProviderUid = KNullUid;
-	        	}
+            TUid pluginUid = iPlugins[ position]->Uid();
+            if(!(iRomBasedPlugins.Find(pluginUid) != KErrNotFound))
+                {
+                    if((iInfoBarProviderUid != iPlugins[position]->Uid())
+                        && (iPreviewPaneProviderUid != iPlugins[ position]->Uid()))
+                        {
+                        CPluginInfo* removedPlugin = iPlugins[ position ];                   
+                        iPlugins.Remove( position );
+                        delete removedPlugin;
+                        }
+                    else 
+                        {
+                        iPlugins[position]->Disable(ETrue);
+                        iDefferedUnloadPluginList.AppendL(iPlugins[position]->Uid());
+                        iInfoBarProviderUid = KNullUid;
+                        iPreviewPaneProviderUid = KNullUid;
+                        }
+                }     
 		   }
         }
     TRACE_EXIT_POINT;
@@ -735,7 +739,7 @@
 // (other items were commented in a header).
 // ----------------------------------------------------------------------------
 //
-void CCalenCustomisationManager::DoImmediatePluginLoadingL()
+void CCalenCustomisationManager::DoImmediatePluginLoadingL(TBool aLoadViewbasedPulgins)
     {
     TRACE_ENTRY_POINT;
 
@@ -755,7 +759,22 @@
     for ( TInt index( 0 ); index < pluginCount; ++index )
         {
         TUid pluginUid = iPluginInfo[index]->ImplementationUid();
-        if ( iActivePlugins.Find( pluginUid ) != KErrNotFound )
+        TBool loadPlugins(EFalse);
+        
+        if(aLoadViewbasedPulgins)
+            {
+            if ( (iActivePlugins.Find( pluginUid ) != KErrNotFound) && 
+                 !(iRomBasedPlugins.Find( pluginUid ) != KErrNotFound) )
+                {
+                loadPlugins = ETrue;
+                }                
+            }
+        else if((iActivePlugins.Find( pluginUid ) != KErrNotFound))
+            {
+            loadPlugins = ETrue;
+            }       
+        
+        if (loadPlugins)
             {
             TRAPD( error, LoadPluginL( pluginUid ) );
             if ( error )
@@ -1473,8 +1492,8 @@
 EXPORT_C void CCalenCustomisationManager::DoPluginLoadingL()
     {
     TRACE_ENTRY_POINT;
-    // Reset and destroy the contents of the owned arrays
-    iPlugins.ResetAndDestroy();
+    // Reset and destroy the contents of the owned arrays    
+    //iPlugins.ResetAndDestroy();
 
     iPluginInfo.ResetAndDestroy();
 
@@ -1485,7 +1504,7 @@
     // create active plugin list
     CreateActivePluginListL();
     
-    DoImmediatePluginLoadingL();
+    DoImmediatePluginLoadingL(ETrue);
     iSetting->LoadL();
     iSetting->UpdatePluginListL(*this);