idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp
branchRCL_3
changeset 93 b01126ce0bec
parent 88 3321d3e205b6
child 102 ba63c83f4716
--- a/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Tue Sep 14 20:58:58 2010 +0300
+++ b/idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp	Wed Sep 15 12:00:00 2010 +0300
@@ -354,6 +354,20 @@
             TRAP_IGNORE( RemovableDiskRemovedL() ); 
             }
         }
+    else if( aEvent.iType == MDiskNotifyHandlerCallback::EDiskAdded )
+        {
+        if( aEvent.iInfo.iType == EMediaHardDisk )
+            {
+            TRAP_IGNORE( RemovableDiskInsertedL() ); 
+            }
+        }
+    else if( aEvent.iType == MDiskNotifyHandlerCallback::EDiskRemoved )
+        {
+        if( aEvent.iInfo.iType == EMediaNotPresent )
+            {
+            TRAP_IGNORE( RemovableDiskRemovedL() ); 
+            }
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1135,9 +1149,9 @@
         RFs& fs( CEikonEnv::Static()->FsSession() );
         if ( path != KNullDesC && BaflUtils::FileExists( fs, path ) )
             {
+
             iIntUpdate++;
-            TInt err( AknsWallpaperUtils::SetIdleWallpaper( path, NULL ) ); 
-                  
+            TInt err( AknsWallpaperUtils::SetIdleWallpaper( path, NULL ) );
             if( err )
                 {
                 iIntUpdate--;
@@ -1160,8 +1174,16 @@
             if( err )
                 {
                 iIntUpdate--;
-                }       
-            }
+                }
+
+            // If the drive was formatted or temporarily detached or the image was removed            
+            if( path.Length() )
+                {
+                iViewManager.ActiveViewData().SetWallpaperImage( NULL );
+                iSkinSrv.RemoveWallpaper( path );
+                DrawNow();
+                }                        
+            }        
         }       
     }