From a0ae434a452deea022e3b7117e946e95542aa884 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 26 Jul 2010 10:33:51 +1000 Subject: Cherry pick fix for MOBILITY-1144 from Qt Mobility. 426ff79e49d4abb659167541bb67846443b9707e --- src/plugins/bearer/symbian/qnetworksession_impl.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index f89ed0a..99737d7 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -1044,6 +1044,11 @@ void QNetworkSessionPrivateImpl::RunL() TInt error = KErrNone; QNetworkConfiguration newActiveConfig = activeConfiguration(); if (!newActiveConfig.isValid()) { + // RConnection startup was successfull but no configuration + // was found. That indicates that user has chosen to create a + // new WLAN configuration (from scan results), but that new + // configuration does not have access to Internet (Internet + // Connectivity Test, ICT, failed). error = KErrGeneral; } else { // Use name of the IAP to open global 'Open C' RConnection @@ -1053,16 +1058,24 @@ void QNetworkSessionPrivateImpl::RunL() strcpy(ifr.ifr_name, nameAsByteArray.constData()); error = setdefaultif(&ifr); } - if (error != KErrNone) { isOpen = false; isOpening = false; iError = QNetworkSession::UnknownSessionError; QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError)); - Cancel(); if (ipConnectionNotifier) { ipConnectionNotifier->StopNotifications(); } + if (!newActiveConfig.isValid()) { + // No valid configuration, bail out. + // Status updates from QNCM won't be received correctly + // because there is no configuration to associate them with so transit here. + iConnection.Close(); + newState(QNetworkSession::Closing); + newState(QNetworkSession::Disconnected); + } else { + Cancel(); + } QT_TRYCATCH_LEAVING(syncStateWithInterface()); return; } -- cgit v0.12 From 0664d3ad029b4d80d9ffac75f4f1c6c47bac2641 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 26 Jul 2010 12:02:36 +1000 Subject: Cherry pick fix for MOBILITY-1145 from Qt Mobility. f17d8a5dbef076046ff504fecb1fd445c9b785ac --- src/plugins/bearer/symbian/qnetworksession_impl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 99737d7..d6b4975 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -1130,7 +1130,9 @@ void QNetworkSessionPrivateImpl::RunL() isOpening = false; activeConfig = QNetworkConfiguration(); serviceConfig = QNetworkConfiguration(); - if (publicConfig.state() == QNetworkConfiguration::Undefined || + if (statusCode == KErrCancel) { + iError = QNetworkSession::SessionAbortedError; + } else if (publicConfig.state() == QNetworkConfiguration::Undefined || publicConfig.state() == QNetworkConfiguration::Defined) { iError = QNetworkSession::InvalidConfigurationError; } else { -- cgit v0.12 From e9e0a82b1a5a71cefdd1711c51b786088b40bafd Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 26 Jul 2010 12:11:03 +1000 Subject: Fix typo in docs. --- doc/src/network-programming/bearermanagement.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/network-programming/bearermanagement.qdoc b/doc/src/network-programming/bearermanagement.qdoc index 67c13f2..bc016df 100644 --- a/doc/src/network-programming/bearermanagement.qdoc +++ b/doc/src/network-programming/bearermanagement.qdoc @@ -191,7 +191,7 @@ closed via \l{QNetworkSession::close()}, respectively. If the session is \l{QNetworkSession::Disconnected}{disconnected} at the time of the \l{QNetworkSession::open()}{open()} call the underlying interface is started; otherwise only the reference counter against the global session is -incremeted. The opposite behavior can be observed when using +incremented. The opposite behavior can be observed when using \l{QNetworkSession::close()}{close()}. In some use cases it may be necessary to turn the interface off despite of -- cgit v0.12 From c16f0a839743af36b36aea9c35f0d5ddfda3d6ac Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Mon, 26 Jul 2010 12:42:06 +1000 Subject: Cherry pick fix for MOBILITY-1077 from Qt Mobility. 7ef45318255c5cf1f10508753c9a2c55fc2cb8c0 321bd8b7b54e34a983b1ba142af836cf3e153a66 --- examples/network/bearercloud/cloud.cpp | 5 +++++ src/network/bearer/qnetworksession.cpp | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/examples/network/bearercloud/cloud.cpp b/examples/network/bearercloud/cloud.cpp index 2856c71..980efbf 100644 --- a/examples/network/bearercloud/cloud.cpp +++ b/examples/network/bearercloud/cloud.cpp @@ -245,6 +245,8 @@ void Cloud::stateChanged(QNetworkSession::State state) else finalOpacity = 1.0; +#if !defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6) && \ + !defined(Q_OS_SYMBIAN) && !defined(Q_OS_WINCE) QString tooltip; if (configuration.name().isEmpty()) @@ -302,6 +304,9 @@ void Cloud::stateChanged(QNetworkSession::State state) tooltip += tr("
Sent data: %1 bytes").arg(session->bytesWritten()); setToolTip(tooltip); +#else + Q_UNUSED(state); +#endif } //! [2] diff --git a/src/network/bearer/qnetworksession.cpp b/src/network/bearer/qnetworksession.cpp index 1ed6cbb..65de539 100644 --- a/src/network/bearer/qnetworksession.cpp +++ b/src/network/bearer/qnetworksession.cpp @@ -629,8 +629,10 @@ void QNetworkSession::reject() If the session is based on a service network configuration the number of sent bytes across all active member configurations are returned. - This function may not always be supported on all platforms and returns - 0. The platform capability can be detected via QNetworkConfigurationManager::DataStatistics. + This function may not always be supported on all platforms and returns 0. + The platform capability can be detected via QNetworkConfigurationManager::DataStatistics. + + \note On some platforms this function may run the main event loop. */ quint64 QNetworkSession::bytesWritten() const { @@ -646,8 +648,10 @@ quint64 QNetworkSession::bytesWritten() const If the session is based on a service network configuration the number of sent bytes across all active member configurations are returned. - This function may not always be supported on all platforms and returns - 0. The platform capability can be detected via QNetworkConfigurationManager::DataStatistics. + This function may not always be supported on all platforms and returns 0. + The platform capability can be detected via QNetworkConfigurationManager::DataStatistics. + + \note On some platforms this function may run the main event loop. */ quint64 QNetworkSession::bytesReceived() const { -- cgit v0.12