Revision: 201015 RCL_3 PDK_3.0.i
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 27 Apr 2010 16:56:32 +0300
branchRCL_3
changeset 14 9941bcf99348
parent 13 f392bfb21e08
child 16 8fcb49b86877
Revision: 201015 Kit: 201017
gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h
gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp
gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp
gssettingsuis/Gs/GSApplication/Src/GSUi.cpp
gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp
gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp
gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h
gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp
gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp
gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp
gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp
gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp
gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp
gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp
--- a/gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h	Wed Apr 14 16:15:29 2010 +0300
+++ b/gsprofilesrv_plat/settings_framework_api/inc/MGSWatchDog.h	Tue Apr 27 16:56:32 2010 +0300
@@ -23,6 +23,11 @@
 // System includes
 #include <e32base.h>
 
+#ifdef _DEBUG
+    #define GS_ENABLE_WATCH_DOG
+#endif
+
+
 // CONSTANTS
 
 // CLASS DECLARATION
--- a/gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSApplication/Src/GSMainContainer.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -126,6 +126,12 @@
 //
 void CGSMainContainer::UpdateListBoxL()
     {
+    
+    if( iPluginArray->Count() == 0 )
+		{
+        return;
+		}
+    
     __GSLOGSTRING( "[CGSMainContainer::UpdateListBoxL]" );
     
     // Empty item array because it will be reoccupied.
--- a/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSApplication/Src/GSMainView.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -144,9 +144,7 @@
 //
 void CGSMainView::OpenLocalizedResourceFileL( const TDesC& aResourceFileName )
     {
-    RFs fsSession;
-    User::LeaveIfError( fsSession.Connect() );
-    CleanupClosePushL( fsSession );
+    RFs &fsSession = CCoeEnv::Static()->FsSession();
 
     // Find the resource file
     TParse parse;
@@ -158,8 +156,6 @@
 
     // Open resource file
     iResourceLoader.OpenL( fileName );
-
-    CleanupStack::PopAndDestroy( &fsSession );
     }
 
 
--- a/gssettingsuis/Gs/GSApplication/Src/GSUi.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSApplication/Src/GSUi.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -179,15 +179,11 @@
     switch ( aCommand )
         {
         case EEikCmdExit:
-            GSDocument().WatchDog()->ReportCleanExitL();
-            Exit();
-            break;
         case EAknCmdExit:
+        case EAknSoftkeyExit:
+        #ifdef GS_ENABLE_WATCH_DOG
             GSDocument().WatchDog()->ReportCleanExitL();
-            Exit();
-            break;
-        case EAknSoftkeyExit:
-            GSDocument().WatchDog()->ReportCleanExitL();
+        #endif
             Exit();
             break;
         default:
@@ -308,7 +304,9 @@
                 new( ELeave ) CAknInformationNote( ETrue );
     note->ExecuteLD( *prompt );
     CleanupStack::PopAndDestroy( prompt );
+#ifdef GS_ENABLE_WATCH_DOG
     GSDocument().WatchDog()->ReportCleanExitL();
+#endif
     Exit();
     }
 
@@ -423,7 +421,9 @@
         {
         case MGSEComObserver::EPluginRemoved:
             __GSLOGSTRING( "[CGSUi::HandleAppListEvent] Closing GS..." );
-            TRAP_IGNORE( GSDocument().WatchDog()->ReportCleanExitL() );
+            #ifdef GS_ENABLE_WATCH_DOG
+                TRAP_IGNORE( GSDocument().WatchDog()->ReportCleanExitL() );
+            #endif
             Exit();
             break;
         default:
--- a/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSCallDivertPlugin/Src/GSCallDivertPluginContainer.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -136,7 +136,17 @@
 // ---------------------------------------------------------------------------
 void CGSCallDivertPluginContainer::MakeVideoDivertsItemL()
     {
-    iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert,
-        CGSListBoxItemTextArray::EVisible );
+	
+     if ( FeatureManager::FeatureSupported(
+           KFeatureIdCsVideoTelephony ) )
+         {
+         iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert,
+             CGSListBoxItemTextArray::EVisible );
+         } 
+     else 
+    	 {
+         iListboxItemArray->SetItemVisibilityL( EGSSettIdVideoDivert,
+             CGSListBoxItemTextArray::EInvisible ); 
+       	 }
     }
 //End of file
--- a/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSDisplayPlugin/Src/GSDisplayPlugin.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -478,7 +478,7 @@
     if ( !dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
         {
 #ifdef FF_POWER_SAVE
-        if ( iPsmActive->Mode() == EPsmsrvModeNormal )
+        if ( iPsmActive->Mode() != EPsmsrvModePowerSave )
             {
 #endif //FF_POWER_SAVE
             iModel->SetContrastL( oldValue );
@@ -512,7 +512,7 @@
     if ( !dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged ) )
         {
 #ifdef FF_POWER_SAVE
-        if ( iPsmActive->Mode() == EPsmsrvModeNormal )
+        if ( iPsmActive->Mode() != EPsmsrvModePowerSave )
             {
 #endif //FF_POWER_SAVE
             iModel->SetBrightnessL( oldValue );
@@ -545,7 +545,7 @@
     if ( !dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
         {
 #ifdef FF_POWER_SAVE
-        if ( iPsmActive->Mode() == EPsmsrvModeNormal )
+        if ( iPsmActive->Mode() != EPsmsrvModePowerSave )
             {
 #endif //FF_POWER_SAVE
             iModel->SetAmbientLightSensorL( oldValue );
--- a/gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/inc/GSPluginAndViewIdCache.h	Tue Apr 27 16:56:32 2010 +0300
@@ -221,8 +221,8 @@
         // UI - not owned
         CEikAppUi& iAppUi;
 
-        // File server session - owned
-        RFs iFsSession;
+        // File server session - ref
+        RFs& iFsSession;
 
         // Cache table - owned
         RHashMap< TUid /* KEY = view id */, TCacheEntry /* VALUE */ > iLookupTable;
--- a/gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/src/GSBaseDocument.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -38,7 +38,8 @@
 //
 EXPORT_C CGSBaseDocument::CGSBaseDocument( CEikApplication& aApp )
 :   CAknDocument( aApp ),
-    iUnloadWrapperObjects( KGSPluginWrapperObjectGranularity )
+    iUnloadWrapperObjects( KGSPluginWrapperObjectGranularity ),
+    iWatchDog ( NULL )
     {
     }
 
@@ -65,7 +66,9 @@
 
     iUnloadWrapperObjects.Close();
     delete iPluginViewIdCache;
+#ifdef GS_ENABLE_WATCH_DOG
     delete iWatchDog;
+#endif
 
     iImplInfoArray.ResetAndDestroy();// This is needed
     iImplInfoArray.Close();
@@ -80,7 +83,9 @@
 //
 EXPORT_C void CGSBaseDocument::ConstructL()
     {
+#ifdef GS_ENABLE_WATCH_DOG
     iWatchDog = CGSWatchDog::NewL();
+#endif
 
     REComSession::ListImplementationsL(
         KGSPluginInterfaceUid,
--- a/gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/src/GSBaseView.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -270,8 +270,7 @@
     const TDesC& aResourceFileName,
     RConeResourceLoader& aResourceLoader )
     {
-    RFs fsSession;
-    User::LeaveIfError( fsSession.Connect() );
+    RFs &fsSession = CCoeEnv::Static()->FsSession();
 
     // Find the resource file:
     TParse parse;
@@ -283,10 +282,6 @@
 
     // Open resource file:
     aResourceLoader.OpenL( fileName );
-
-    // If leave occurs before this, close is called automatically when the
-    // thread exits.
-    fsSession.Close();
     }
 
 
--- a/gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/src/GSParentContainer.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -156,7 +156,10 @@
         // Adding plugin data to lbx has a lot of CGSPluginInterface API calls.
         // -> A good place to use quarantine to catch panicking plugins in
         // any of these calls.
-        iGSWatchDog->QuarantineL( plugin->Id() );
+        #ifdef GS_ENABLE_WATCH_DOG
+            iGSWatchDog->QuarantineL( plugin->Id() );
+        #endif
+            
         if( plugin->Visible() )
             {
             AddPluginDataToLbxL( plugin,
@@ -164,7 +167,9 @@
                                  icons,
                                  iconCounter );
             }
-        iGSWatchDog->RemoveFromQuarantineL( plugin->Id() );
+        #ifdef GS_ENABLE_WATCH_DOG
+            iGSWatchDog->RemoveFromQuarantineL( plugin->Id() );
+        #endif
         }
 
     // 2) Replace old icon array if needed.
--- a/gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/src/GSParentPlugin.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -152,8 +152,7 @@
     const TDesC& aResourceFileName,
     RConeResourceLoader& aResourceLoader )
     {
-    RFs fsSession;
-    User::LeaveIfError( fsSession.Connect() );
+    RFs &fsSession = CCoeEnv::Static()->FsSession();
 
     // Find the resource file:
     TParse parse;
@@ -165,10 +164,6 @@
 
     // Open resource file:
     aResourceLoader.OpenL( fileName );
-
-    // If leave occurs before this, close is called automatically when the
-    // thread exits.
-    fsSession.Close();
     }
 
 
--- a/gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/src/GSPluginAndViewIdCache.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -42,7 +42,7 @@
 // ---------------------------------------------------------------------------
 //
 CGSPluginAndViewIdCache::CGSPluginAndViewIdCache( CEikAppUi& aAppUi )
-:   iAppUi( aAppUi ), iLookupTable( &HashFunction, &HashIdentityRelation )
+:   iAppUi( aAppUi ), iFsSession(CCoeEnv::Static()->FsSession()),iLookupTable( &HashFunction, &HashIdentityRelation )
     {
     }
 
@@ -60,7 +60,6 @@
     DestroyShims();
     iLookupTable.Close();
     //
-    iFsSession.Close();
     }
 
 
@@ -72,7 +71,6 @@
 //
 void CGSPluginAndViewIdCache::ConstructL()
     {
-    User::LeaveIfError( iFsSession.Connect() );
     User::LeaveIfError( iFsSession.CreatePrivatePath( EDriveC ) );
     //
     iPlaceholderView = CGSPlaceholderView::NewL( iAppUi );
--- a/gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSFramework/src/GSPluginLoader.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -486,12 +486,16 @@
                     &info->DisplayName(), iParentUid.iUid );
             CGSPluginInterface* plugin = NULL;
             TInt error = KErrCancel;
+        #ifdef GS_ENABLE_WATCH_DOG
             if( !iWatchDog->IsInBlackList( info->ImplementationUid() ) )
+        #endif
                 {
                 // Only panics move quarantined plugins to blacklist. Leaving is
                 // normal programmatic functionality and therefore does not move
                 // plugin to blacklist.
-                iWatchDog->QuarantineL( info->ImplementationUid() );
+                #ifdef GS_ENABLE_WATCH_DOG
+                    iWatchDog->QuarantineL( info->ImplementationUid() );
+                #endif
 
                 #ifdef _GS_PERFORMANCE_TRACES
                     TTime timeStart;
@@ -508,7 +512,9 @@
                     __GSLOGSTRING2( "[GSPlgLoader::LoadNextPluginL/perf] %Ld    (%S)", funcDuration, &info->DisplayName() );
                 #endif //_GS_PERFORMANCE_TRACES
 
-                TRAP_IGNORE( iWatchDog->RemoveFromQuarantineL( info->ImplementationUid() ); );
+                #ifdef GS_ENABLE_WATCH_DOG
+                    TRAP_IGNORE( iWatchDog->RemoveFromQuarantineL( info->ImplementationUid() ); );
+                #endif
                 }
             if( error == KErrNone )
                 {
--- a/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp	Wed Apr 14 16:15:29 2010 +0300
+++ b/gssettingsuis/Gs/GSPDataHSDPAPlugin/src/GSPDataHSDPAPlugin.cpp	Tue Apr 27 16:56:32 2010 +0300
@@ -460,9 +460,8 @@
 	
 	if( iProfileEngine->ActiveProfileId() != EProfileOffLineId )
 		{	
-		User::LeaveIfError( rSession.Connect() );		
-		rSession.SetState( RStarterSession::EOffline );
-		rSession.SetState( RStarterSession::ENormal );
+		User::LeaveIfError( rSession.Connect() );	
+		rSession.ResetNetwork();
 		rSession.Close();
 		}