diff -r 7e15987c4500 -r 8c311f9acc5e usbuis/usbuinotif/src/usbuinotifotgerror.cpp --- a/usbuis/usbuinotif/src/usbuinotifotgerror.cpp Tue Feb 02 00:52:37 2010 +0200 +++ b/usbuis/usbuinotif/src/usbuinotifotgerror.cpp Fri Mar 19 09:48:52 2010 +0200 @@ -23,7 +23,6 @@ #include // Localisation stringloader #include #include -#include #include // pck #include // Own resources @@ -67,8 +66,6 @@ //this virtual function call is to local CUsbUiNotifOtgError::Cancel, //not to any possibly derived class implementation. Cancel(); - delete iDialerWatcher; - delete iQuery; } void CUsbUiNotifOtgError::ConstructL() @@ -108,18 +105,24 @@ { User::Leave( KErrInUse ); } - - iMessage = aMessage; - iNeedToCompleteMessage = ETrue; - iReplySlot = aReplySlot; - + // Get parameters // - iErrorId = 0; + TPckgC pckg( iErrorId ); pckg.Set( aBuffer ); iErrorId = pckg(); - + + FTRACE(FPrint(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::GetParamsL iErrorId: %d"), iErrorId )); + if ( iErrorId < 0 || iErrorId >= iStringIds.Count() ) + { + User::Leave( KErrArgument); + } + + iMessage = aMessage; + iNeedToCompleteMessage = ETrue; + iReplySlot = aReplySlot; + SetActive(); iStatus = KRequestPending; TRequestStatus* stat = &iStatus; @@ -136,29 +139,16 @@ { FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::RunL")); TInt returnValue = KErrNone; - FeatureManager::InitializeLibL(); - if ( FeatureManager::FeatureSupported( KFeatureIdFfKeypadNoSendKey ) ) - { - if (!iDialerWatcher) - { - iDialerWatcher = CUsbuinotifDialerWatcher::NewL(this); - } - } - FeatureManager::UnInitializeLib(); - iDismissed=EFalse; + DisableKeylock(); SuppressAppSwitching( ETrue ); //Excute dialog and check return value returnValue = QueryUserResponseL(); - if (!iDismissed) - { - SuppressAppSwitching( EFalse ); - RestoreKeylock(); - delete iDialerWatcher; - iDialerWatcher = NULL; - CompleteMessage( returnValue ); - } + + SuppressAppSwitching( EFalse ); + RestoreKeylock(); + CompleteMessage( returnValue ); FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::RunL() completed")); } @@ -170,54 +160,15 @@ // void CUsbUiNotifOtgError::Cancel() { - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel")); - - // If dialog is not dismissed this is normal cancel and if query - // doesn't exsist notifier is canceled during dismission - if (!iDismissed || !iQuery ) - { - delete iDialerWatcher; - iDialerWatcher = NULL; - CompleteMessage( KErrCancel ); - } + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel")); if (iQuery) { delete iQuery; iQuery = NULL; } - FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel() completed")); - } + CompleteMessage( KErrCancel ); -// ---------------------------------------------------------------------------- -// CUsbUiNotifOtgError::DialerActivated -// Release all own resources (member variables) -// ---------------------------------------------------------------------------- -// -void CUsbUiNotifOtgError::DialerActivated() - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::AppKeyPressed()")); - if ( iQuery ) - { - iDismissed=ETrue; - Cancel(); - } - } - -// ---------------------------------------------------------------------------- -// CUsbUiNotifOtgError::ReActivateDialog -// Release all own resources (member variables) -// ---------------------------------------------------------------------------- -// -void CUsbUiNotifOtgError::ReActivateDialog() - { - FLOG(_L("[USBUINOTIF]\t CUSBUINotifierBase::ReActivateDialog()")); - if ( !IsActive()) - { - SetActive(); - iStatus = KRequestPending; - TRequestStatus* stat = &iStatus; - User::RequestComplete( stat, KErrNone ); - } + FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::Cancel() completed")); } // ---------------------------------------------------------------------------- @@ -230,17 +181,9 @@ FLOG(_L("[USBUINOTIF]\t CUsbUiNotifOtgError::QueryUserResponseL")); TInt returnValue = KErrNone; TInt resourceId = R_USB_QUERY_OTG_ERROR; - if (iDismissed) - { - iQuery = CAknQueryDialog::NewL(); - } - else - { - iQuery = CAknQueryDialog::NewL( CAknQueryDialog::EErrorTone ); - } - - - iDismissed=EFalse; + + iQuery = CAknQueryDialog::NewL( CAknQueryDialog::EErrorTone ); + if (iCoverDisplaySupported) { iQuery->PublishDialogL( iErrorId, KUsbUiNotifOtgError );