idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp
branchRCL_3
changeset 78 89165693e770
parent 59 d721605b30d0
child 79 f00a6757af32
--- a/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Mon Jun 21 15:27:11 2010 +0300
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Thu Jul 15 18:25:29 2010 +0300
@@ -149,6 +149,12 @@
 //
 void CXnBackgroundManager::ConstructL()
     {    
+    // Connect to skin server.
+    User::LeaveIfError( iSkinSrv.Connect( this ) );
+          
+    // Start listening for drive events.
+    User::LeaveIfError( iFsSession.Connect() );
+
     CreateWindowL();
 
     iRect = TRect();
@@ -165,11 +171,6 @@
     ActivateL();
     iIntUpdate = 0;
     
-    User::LeaveIfError( iSkinSrv.Connect( this ) );
-          
-    // Start listening for drive events.
-    User::LeaveIfError( iFsSession.Connect() );
-    
     // Start listening file server notifications.
     iDiskNotifier = CDiskNotifyHandler::NewL( *this, iFsSession );
     User::LeaveIfError( iDiskNotifier->NotifyDisk() );
@@ -177,7 +178,7 @@
     // Reads from cenrep wheteher page specific wallpaper is enabled or not
     CheckFeatureTypeL();   
     
-    GfxTransEffect::Register( this, KGfxContextBgAppear );       
+    GfxTransEffect::Register( this, KGfxContextBgAppear );
     }
 
 // -----------------------------------------------------------------------------
@@ -201,7 +202,10 @@
 //
 CXnBackgroundManager::~CXnBackgroundManager()
     {
-    GfxTransEffect::Deregister( this );
+    if ( GfxTransEffect::IsRegistered( this) )
+        {
+        GfxTransEffect::Deregister( this );
+        }
         
     iSkinSrv.RemoveAllWallpapers();
     iSkinSrv.Close();
@@ -1112,7 +1116,8 @@
 
         CXnViewData& activeView = iViewManager.ActiveViewData();
         const TDesC& path( activeView.WallpaperImagePath() );
-        if( path != KNullDesC && activeView.WallpaperImage() )
+        RFs& fs( CEikonEnv::Static()->FsSession() );
+        if ( path != KNullDesC && BaflUtils::FileExists( fs, path ) )
             {
             iIntUpdate++;
             TInt err( AknsWallpaperUtils::SetIdleWallpaper( path, NULL ) );