diff -r aba6b8104af3 -r 51c0f5edf5ef iaupdate/IAD/ui/src/iaupdateuicontroller.cpp --- a/iaupdate/IAD/ui/src/iaupdateuicontroller.cpp Tue Feb 02 00:20:15 2010 +0200 +++ b/iaupdate/IAD/ui/src/iaupdateuicontroller.cpp Fri Feb 19 22:57:02 2010 +0200 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -360,19 +361,23 @@ return; } } - - if ( iRequestType == IAUpdateUiDefines::EShowUpdates && iRefreshed ) + if ( iRequestType == IAUpdateUiDefines::ECheckUpdates && + AllowNetworkRefreshL() && + iRoamingHandler->IsRoaming() && + !AutomaticConnectionWhenRoamingL() ) + { + // In Silent check updates case, global setting when roaming to be automatic + // Promt dialog is not allowed in the silent check + // error is returned that a client (backround checker) will try again later + iObserver.RefreshCompleteL( EFalse, KErrAbort ); + } + else if ( iRequestType == IAUpdateUiDefines::EShowUpdates && iRefreshed ) { iFilter->FilterAndSortNodesL( iNodes, iFwNodes ); iObserver.RefreshCompleteL( ETrue, KErrNone ); } else { - if ( IsStartedByLauncher() && AllowNetworkRefreshL() ) - { - iUserRoamingRejection = iRoamingHandler->RoamingRejectionL(); - } - TInt ret( iController->Startup() ); if ( ret == KErrAlreadyExists ) { @@ -411,43 +416,39 @@ // started. iController->ResetSelfUpdate(); - iUserRoamingRejection = iRoamingHandler->RoamingRejectionL(); - if ( !iUserRoamingRejection ) + CreateSelectedNodesArrayL(); + + if ( !IAUpdateUtils::SpaceAvailableInInternalDrivesL( iSelectedNodesArray ) ) { - CreateSelectedNodesArrayL(); - - if ( !IAUpdateUtils::SpaceAvailableInInternalDrivesL( iSelectedNodesArray ) ) + HBufC* noteText = NULL; + noteText = StringLoader::LoadLC( R_IAUPDATE_INSUFFICIENT_MEMORY ); + IAUpdateDialogUtil::ShowInformationQueryL( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + if ( !IsStartedByLauncher() ) { - HBufC* noteText = NULL; - noteText = StringLoader::LoadLC( R_IAUPDATE_INSUFFICIENT_MEMORY ); - IAUpdateDialogUtil::ShowInformationQueryL( *noteText ); - CleanupStack::PopAndDestroy( noteText ); - } - else - { - if ( !IsStartedByLauncher() ) + if ( !iStarter ) { - if ( !iStarter ) - { - // Notice, that the ownership of the filter parameters will - // remain in the filter. - CIAUpdateParameters* params = iFilter->FilterParams(); - iStarter = CIAUpdateStarter::NewL( params->CommandLineExecutable(), + // Notice, that the ownership of the filter parameters will + // remain in the filter. + CIAUpdateParameters* params = iFilter->FilterParams(); + iStarter = CIAUpdateStarter::NewL( params->CommandLineExecutable(), params->CommandLineArguments() ); - } } - // Inform the controller that we are now starting updates. This way the - // controller can handle situations as a whole and not as one item at the - // time. - iController->StartingUpdatesL(); + } + // Inform the controller that we are now starting updates. This way the + // controller can handle situations as a whole and not as one item at the + // time. + iController->StartingUpdatesL(); - iFileInUseError = EFalse; - // Set the node index to -1 because ContinueUpdateL increases it by one - // in the beginning of the function. So, we can use the ContinueUpdateL - // also in here. - iNodeIndex = -1; - ContinueUpdateL( EFalse ); - } + iFileInUseError = EFalse; + // Set the node index to -1 because ContinueUpdateL increases it by one + // in the beginning of the function. So, we can use the ContinueUpdateL + // also in here. + iNodeIndex = -1; + ContinueUpdateL( EFalse ); } IAUPDATE_TRACE("[IAUPDATE] CIAUpdateUiController::StartUpdateL() end"); @@ -2267,7 +2268,6 @@ if ( IsStartedByLauncher() ) { if ( !iRefreshFromNetworkDenied && - !iUserRoamingRejection && !RestartedFromSelfUpdate() ) { if ( LocalNodesExpiredL() ) @@ -2718,4 +2718,24 @@ return enabled; } +// --------------------------------------------------------------------------- +// CIAUpdateUiController::AutomaticConnectionWhenRoamingL() +// --------------------------------------------------------------------------- +// +TBool CIAUpdateUiController::AutomaticConnectionWhenRoamingL() const + { + TBool automaticConnection = EFalse; + RCmManager cmManager; + cmManager.OpenLC(); + TCmGenConnSettings genConnSettings; + cmManager.ReadGenConnSettingsL( genConnSettings ); + CleanupStack::PopAndDestroy( &cmManager ); + if ( genConnSettings.iCellularDataUsageVisitor == ECmCellularDataUsageAutomatic ) + { + automaticConnection = ETrue; + } + return automaticConnection; + } + + // End of File