calendarui/customisationmanager/src/calencustomisationmanager.cpp
branchRCL_3
changeset 36 9c5b1510919f
parent 0 f979ecb2b13e
child 60 96907930389d
equal deleted inserted replaced
30:d68a4b5d5885 36:9c5b1510919f
   498     for (TInt index = 0; index < count; ++index )
   498     for (TInt index = 0; index < count; ++index )
   499         {
   499         {
   500         TInt position = iPlugins.Find( aPlugins[index], CPluginInfo::Identifier );
   500         TInt position = iPlugins.Find( aPlugins[index], CPluginInfo::Identifier );
   501         if ( position != KErrNotFound ) 
   501         if ( position != KErrNotFound ) 
   502 	        {
   502 	        {
   503         	if((iInfoBarProviderUid != iPlugins[position]->Uid())
   503             TUid pluginUid = iPlugins[ position]->Uid();
   504         		&& (iPreviewPaneProviderUid != iPlugins[ position]->Uid()))
   504             if(!(iRomBasedPlugins.Find(pluginUid) != KErrNotFound))
   505 	            {
   505                 {
   506 	            CPluginInfo* removedPlugin = iPlugins[ position ];
   506                     if((iInfoBarProviderUid != iPlugins[position]->Uid())
   507 	            iPlugins.Remove( position );
   507                         && (iPreviewPaneProviderUid != iPlugins[ position]->Uid()))
   508 	            delete removedPlugin;
   508                         {
   509 	            }
   509                         CPluginInfo* removedPlugin = iPlugins[ position ];                   
   510         	else 
   510                         iPlugins.Remove( position );
   511 	        	{
   511                         delete removedPlugin;
   512 	        	iPlugins[position]->Disable(ETrue);
   512                         }
   513 				iDefferedUnloadPluginList.AppendL(iPlugins[position]->Uid());
   513                     else 
   514 				iInfoBarProviderUid = KNullUid;
   514                         {
   515 				iPreviewPaneProviderUid = KNullUid;
   515                         iPlugins[position]->Disable(ETrue);
   516 	        	}
   516                         iDefferedUnloadPluginList.AppendL(iPlugins[position]->Uid());
       
   517                         iInfoBarProviderUid = KNullUid;
       
   518                         iPreviewPaneProviderUid = KNullUid;
       
   519                         }
       
   520                 }     
   517 		   }
   521 		   }
   518         }
   522         }
   519     TRACE_EXIT_POINT;
   523     TRACE_EXIT_POINT;
   520     }
   524     }
   521 
   525 
   733 // Examines the properties of the plugin list and
   737 // Examines the properties of the plugin list and
   734 // loads those that need to loaded on start-up
   738 // loads those that need to loaded on start-up
   735 // (other items were commented in a header).
   739 // (other items were commented in a header).
   736 // ----------------------------------------------------------------------------
   740 // ----------------------------------------------------------------------------
   737 //
   741 //
   738 void CCalenCustomisationManager::DoImmediatePluginLoadingL()
   742 void CCalenCustomisationManager::DoImmediatePluginLoadingL(TBool aLoadViewbasedPulgins)
   739     {
   743     {
   740     TRACE_ENTRY_POINT;
   744     TRACE_ENTRY_POINT;
   741 
   745 
   742     
   746     
   743     for(TInt i = 0 ; i < iPlugins.Count() ; i++)
   747     for(TInt i = 0 ; i < iPlugins.Count() ; i++)
   753     TInt pluginCount = iPluginInfo.Count();
   757     TInt pluginCount = iPluginInfo.Count();
   754 
   758 
   755     for ( TInt index( 0 ); index < pluginCount; ++index )
   759     for ( TInt index( 0 ); index < pluginCount; ++index )
   756         {
   760         {
   757         TUid pluginUid = iPluginInfo[index]->ImplementationUid();
   761         TUid pluginUid = iPluginInfo[index]->ImplementationUid();
   758         if ( iActivePlugins.Find( pluginUid ) != KErrNotFound )
   762         TBool loadPlugins(EFalse);
       
   763         
       
   764         if(aLoadViewbasedPulgins)
       
   765             {
       
   766             if ( (iActivePlugins.Find( pluginUid ) != KErrNotFound) && 
       
   767                  !(iRomBasedPlugins.Find( pluginUid ) != KErrNotFound) )
       
   768                 {
       
   769                 loadPlugins = ETrue;
       
   770                 }                
       
   771             }
       
   772         else if((iActivePlugins.Find( pluginUid ) != KErrNotFound))
       
   773             {
       
   774             loadPlugins = ETrue;
       
   775             }       
       
   776         
       
   777         if (loadPlugins)
   759             {
   778             {
   760             TRAPD( error, LoadPluginL( pluginUid ) );
   779             TRAPD( error, LoadPluginL( pluginUid ) );
   761             if ( error )
   780             if ( error )
   762                 {
   781                 {
   763                 // report a problem loading the plugin
   782                 // report a problem loading the plugin
  1471 // ----------------------------------------------------------------------------
  1490 // ----------------------------------------------------------------------------
  1472 //
  1491 //
  1473 EXPORT_C void CCalenCustomisationManager::DoPluginLoadingL()
  1492 EXPORT_C void CCalenCustomisationManager::DoPluginLoadingL()
  1474     {
  1493     {
  1475     TRACE_ENTRY_POINT;
  1494     TRACE_ENTRY_POINT;
  1476     // Reset and destroy the contents of the owned arrays
  1495     // Reset and destroy the contents of the owned arrays    
  1477     iPlugins.ResetAndDestroy();
  1496     //iPlugins.ResetAndDestroy();
  1478 
  1497 
  1479     iPluginInfo.ResetAndDestroy();
  1498     iPluginInfo.ResetAndDestroy();
  1480 
  1499 
  1481     iActivePlugins.Reset();
  1500     iActivePlugins.Reset();
  1482 
  1501 
  1483     iHiddenViews.Reset();
  1502     iHiddenViews.Reset();
  1484     iDefferedUnloadPluginList.Reset();
  1503     iDefferedUnloadPluginList.Reset();
  1485     // create active plugin list
  1504     // create active plugin list
  1486     CreateActivePluginListL();
  1505     CreateActivePluginListL();
  1487     
  1506     
  1488     DoImmediatePluginLoadingL();
  1507     DoImmediatePluginLoadingL(ETrue);
  1489     iSetting->LoadL();
  1508     iSetting->LoadL();
  1490     iSetting->UpdatePluginListL(*this);
  1509     iSetting->UpdatePluginListL(*this);
  1491     
  1510     
  1492     TRACE_EXIT_POINT;
  1511     TRACE_EXIT_POINT;
  1493     }
  1512     }