diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-06-30 02:22:25 (GMT) |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-06-30 02:22:25 (GMT) |
commit | a9b6c59857c28f48e093abccaf9a89755b0995bc (patch) | |
tree | 0af25583601858bca4f2d61540220a9c10890e35 /src/plugins | |
parent | 5a6d8c40791da2e8751965d05ae2d5ef69bed301 (diff) | |
parent | 587b0fed9bd17a378eb0212c95074df965549ef2 (diff) | |
download | Qt-a9b6c59857c28f48e093abccaf9a89755b0995bc.zip Qt-a9b6c59857c28f48e093abccaf9a89755b0995bc.tar.gz Qt-a9b6c59857c28f48e093abccaf9a89755b0995bc.tar.bz2 |
Merge branch '4.7' of git://gitorious.org/qt/qt into 4.7
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.cpp | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index a6acce0..e375b4f 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -879,9 +879,28 @@ void QNetworkSessionPrivateImpl::close() lastError = QNetworkSession::OperationNotSupportedError; emit QNetworkSessionPrivate::error(lastError); } else if (isOpen) { - opened = false; - isOpen = false; - emit closed(); + if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) { + // We will not wait any disconnect from icd as it might never come + Maemo::Icd icd; +#ifdef BEARER_MANAGEMENT_DEBUG + qDebug() << "closing session" << publicConfig.identifier(); +#endif + state = QNetworkSession::Closing; + emit stateChanged(state); + + opened = false; + isOpen = false; + + // we fake a disconnection, session error is not sent + updateState(QNetworkSession::Disconnected); + + icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT); + startTime = QDateTime(); + } else { + opened = false; + isOpen = false; + emit closed(); + } } } @@ -896,33 +915,25 @@ void QNetworkSessionPrivateImpl::stop() emit QNetworkSessionPrivate::error(lastError); } else { if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) { - if (!m_stopTimer.isActive()) { - Maemo::Icd icd; + Maemo::Icd icd; #ifdef BEARER_MANAGEMENT_DEBUG - qDebug() << "stopping session" << publicConfig.identifier(); + qDebug() << "stopping session" << publicConfig.identifier(); #endif - state = QNetworkSession::Closing; - emit stateChanged(state); - - opened = false; - isOpen = false; + state = QNetworkSession::Closing; + emit stateChanged(state); - icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT); - startTime = QDateTime(); + // we fake a disconnection, a session error is sent also + updateState(QNetworkSession::Disconnected); - /* Note: Session state will change to disconnected - * as soon as QNetworkConfigurationManager sends - * corresponding iapStateChanged signal. - */ + opened = false; + isOpen = false; - // Make sure that this Session will send closed signal - // even though ICD connection will not ever get closed - m_stopTimer.start(ICD_SHORT_CONNECT_TIMEOUT); // 10 seconds wait - } + icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT); + startTime = QDateTime(); } else { opened = false; isOpen = false; - emit closed(); + emit closed(); } } } |