diff -r 22c3c67e5001 -r c45d4fe2ff0a cmmanager/cmmgr/Framework/Src/cmdlg.cpp --- a/cmmanager/cmmgr/Framework/Src/cmdlg.cpp Tue Apr 27 17:03:25 2010 +0300 +++ b/cmmanager/cmmgr/Framework/Src/cmdlg.cpp Tue May 11 16:35:05 2010 +0300 @@ -112,6 +112,7 @@ , iExitduringProcessing( EFalse ) , iBackduringProcessing( EFalse ) , iDestDlg( aDestDlg ) + , iPluginExitExceptionally( EFalse ) { } @@ -136,7 +137,7 @@ // set old text back, if we have it... if ( iOldTitleText ) { - if ( iExitReason == KDialogUserBack ) + if ( iExitReason == KDialogUserBack || iPluginExitExceptionally ) { TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) ); } @@ -482,6 +483,11 @@ { retVal = ETrue; } + + if ( iPluginExitExceptionally ) + { + retVal = ETrue; + } } break; } @@ -1141,11 +1147,6 @@ CleanupStack::PopAndDestroy( dest ); HandleListboxDataChangeL(); } - else - { - CleanupStack::PopAndDestroy( &destArray ); - User::Leave( KErrCancel ); - } CleanupStack::PopAndDestroy( &destArray ); } @@ -1226,6 +1227,7 @@ iCmDestinationImpl->UpdateL(); HandleListboxDataChangeL(); + iListbox->HandleItemRemovalL(); } CleanupStack::PopAndDestroy( &destArray ); @@ -1275,7 +1277,15 @@ TInt ret = cm->RunSettingsL(); if ( ret == KDialogUserExit ) { - TryExitL( KDialogUserExit ); + if( IsExceptionExitL() ) + { + iPluginExitExceptionally = ETrue; + TryExitL( KDialogUserBack ); + } + else + { + TryExitL( KDialogUserExit ); + } } else { @@ -1675,7 +1685,6 @@ if ( selected >= 0 ) { iListbox->ScrollToMakeItemVisible( selected); - iListbox->SetCurrentItemIndexAndDraw( selected ); } } } @@ -2003,3 +2012,24 @@ // Update list box HandleListboxDataChangeL(); } + +// -------------------------------------------------------------------------- +// CCmDlg::IsExceptionExitL +// -------------------------------------------------------------------------- +// +TBool CCmDlg::IsExceptionExitL() + { + TBool retV( EFalse ); + + if (iCmDestinationImpl) + { + // If the destination that is currently working on disappears + // with some reason then go back to parent view + if( !iCmManager->DestinationStillExistedL( iCmDestinationImpl ) ) + { + retV = ETrue; + } + } + + return retV; + }