uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp
branchRCL_3
changeset 29 a8834a2e9a96
parent 16 71dd06cfe933
child 51 fcdfafb36fe7
--- a/uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp	Tue May 25 12:58:19 2010 +0300
+++ b/uifw/AknGlobalUI/AknCapServer/src/AknCapServerEntry.cpp	Wed Jun 09 09:58:37 2010 +0300
@@ -371,10 +371,6 @@
     TFileName fileName(KEikSrvUIResFileName);
     BaflUtils::NearestLanguageFile(iEikonEnv->FsSession(),fileName);
     iResourceFileOffset=iCoeEnv->AddResourceFileL(fileName);
-
-    // Create FSW
-    iFSControl= new (ELeave) CAknFastSwapWindowControl(*this);
-    iFSControl->ConstructL();
     
     // MMC unlocker
     iMMCUnlock = CAknMMCPasswordRequester::NewL();
@@ -489,8 +485,14 @@
 
     // Create capserver discreetpopuphandler     
     CAknCapServerDiscreetPopupHandler::CreateDiscreetPopupHandlerL();     
-	LoadAlternateFsPlugin();
-
+	
+    LoadAlternateFsPlugin();
+    // Create FSW
+    if ( iAlternateFS == NULL )
+        {
+        iFSControl= new (ELeave) CAknFastSwapWindowControl(*this);
+        iFSControl->ConstructL();
+        }
 	ProcessInitFlipStatus();
     }
     
@@ -584,19 +586,22 @@
                     }
                 else
                     {
-                    if ( aMessage.Int0() )
-                        {
-                        TInt err = KErrNone;
-                        TRAP( err, iFSControl->InitializeWindowGroupListL( EFalse ));
-                        if ( !err )
-                            {   
-                            iFSControl->RunFastSwapL();             
+                    if ( iFSControl )
+                    	{
+                        if ( aMessage.Int0() )
+                            {
+                            TInt err = KErrNone;
+                            TRAP( err, iFSControl->InitializeWindowGroupListL( EFalse ));
+                            if ( !err )
+                                {   
+                                iFSControl->RunFastSwapL();             
+                                }
                             }
-                        }
-                    else
-                        {
-                        iFSControl->CloseFastSwap();
-                        }                        
+                        else
+                            {
+                            iFSControl->CloseFastSwap();
+                            }  
+                    	}
                     }
                 }
             aMessage.Complete(KErrNone);
@@ -607,7 +612,10 @@
             TInt err = UpdateTaskListL( ETrue );
             if ( err != KErrNone )
                 {
-                iFSControl->CloseFastSwap();
+                if ( iFSControl )
+                	{
+                    iFSControl->CloseFastSwap();
+                	}
                 }
             aMessage.Complete(err);
             break;
@@ -802,11 +810,15 @@
         iAlternateFS->HandleShortAppKeyPress();
         return ETrue;
         }
-    if (iFSControl->IsVisible())
-        {
-        iFSControl->HandleShortAppsKeyPressL();
-        return ETrue;
-        }
+    if ( iFSControl )
+    	{
+        if (iFSControl->IsVisible())
+            {
+            iFSControl->HandleShortAppsKeyPressL();
+            return ETrue;
+            }
+    	}
+    
         
     return EFalse;
     }
@@ -821,21 +833,25 @@
             }
         else
             {
-            if (iFSControl->IsVisible())
-                {
-                iFSControl->HandleLongAppsKeyPressL();
-                }
-            else
-                {
-                if (iFSControl->VisibleWindowGroupsCountL()<1)
+            if ( iFSControl )
+            	{
+                if ( iFSControl->IsVisible())
                     {
-                    return EFalse;
+                    iFSControl->HandleLongAppsKeyPressL();
                     }
                 else
                     {
-                    iFSControl->RunFastSwapL();
+                    if (iFSControl->VisibleWindowGroupsCountL()<1)
+                        {
+                        return EFalse;
+                        }
+                    else
+                        {
+                        iFSControl->RunFastSwapL();
+                        }
                     }
-                }            
+            	}
+                        
             }
         }
     return ETrue;
@@ -1007,7 +1023,9 @@
     
 void CAknCapAppServerAppUi::HandleWsEventL(const TWsEvent& aEvent,CCoeControl* aDestination)
     {
-    if ( iMessageReaderLongPressDetector && !IsAppsKeySuppressed() && !iFSControl->IsDisplayed() )
+    if ( iMessageReaderLongPressDetector && 
+    	 !IsAppsKeySuppressed() && 
+    	 ( iFSControl == NULL || !iFSControl->IsDisplayed() ) )
         {
         // Message Reader can be launched by long pressing left soft key 
         // events need to be intercepted/consumed before they are forwarded to cba
@@ -1067,7 +1085,7 @@
 TInt CAknCapAppServerAppUi::UpdateTaskListL( TBool aTaskListRefreshNeeded )
     {
     TInt err = KErrNone;
-    if ( iFSControl->IsDisplayed() )
+    if ( iFSControl && iFSControl->IsDisplayed() )
         {
         // update window group list (task list)
         TInt windowGroupListChanged = ETrue;