idlehomescreen/xmluirendering/uiengine/src/xnbackgroundmanager.cpp
branchRCL_3
changeset 19 79311d856354
parent 18 d05a55b217df
child 23 7be2816dbabd
equal deleted inserted replaced
18:d05a55b217df 19:79311d856354
   778         }
   778         }
   779 
   779 
   780     // Add new to the cache
   780     // Add new to the cache
   781     if( aFileName != KNullDesC )
   781     if( aFileName != KNullDesC )
   782         {
   782         {
   783         if( CacheWallpaperL( aFileName, viewData ) == KErrNone )
   783         err = CacheWallpaperL( aFileName, viewData ); 
       
   784     
       
   785         if( err == KErrNone )
   784             {
   786             {
   785             SaveWallpaperL(); // to HSPS
   787             SaveWallpaperL(); // to HSPS
   786             }
   788             }
   787         else
   789         else
   788             {
   790             {
   789             // image is corrupted or format is not supported
   791             return err;
   790             return KErrCACorruptContent;
       
   791             }
   792             }
   792         }
   793         }
   793     // WallpaperImage changed back to default. Update view data.
   794     // WallpaperImage changed back to default. Update view data.
   794     else
   795     else
   795         {
   796         {
   830 
   831 
   831     if( aFileName != KNullDesC )
   832     if( aFileName != KNullDesC )
   832         {
   833         {
   833         iBgImagePath = aFileName.AllocL();
   834         iBgImagePath = aFileName.AllocL();
   834     
   835     
   835         TBool err( KErrNone );
   836         err = KErrNone;
   836         TRAP( err, iSkinSrv.AddWallpaperL( aFileName, iRect.Size() ) );
   837         TRAP( err, iSkinSrv.AddWallpaperL( aFileName, iRect.Size() ) );
   837         if( err )
   838         if( err != KErrNone )
   838             {
   839             {
   839             // image is corrupted or format is not supported
   840             return err;
   840             return KErrCACorruptContent;
   841             }
   841             }
   842         
   842         TRAP( err, iBgImage = iSkinSrv.WallpaperImageL( aFileName ) );
   843         TRAP( err, iBgImage = iSkinSrv.WallpaperImageL( aFileName ) );
   843         if( err )
   844         if( err )
   844             {
   845             {
   845             iSkinSrv.RemoveWallpaper( aFileName );
   846             iSkinSrv.RemoveWallpaper( aFileName );
   846             delete iBgImage;
   847             delete iBgImage;