diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-09-01 05:00:54 (GMT) |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-09-01 05:00:54 (GMT) |
commit | 036d7afd42ce3ca9736e173a72bc5228a1eb211d (patch) | |
tree | bbeefb4384b393e860350a8a6142fa7d27141644 /src/plugins | |
parent | 87bc302810b97bd647187e5e31f5276ae729dce0 (diff) | |
parent | 31e4efaf2178b81552e875eb5a1d5a894310e561 (diff) | |
download | Qt-036d7afd42ce3ca9736e173a72bc5228a1eb211d.zip Qt-036d7afd42ce3ca9736e173a72bc5228a1eb211d.tar.gz Qt-036d7afd42ce3ca9736e173a72bc5228a1eb211d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.cpp | 6 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.cpp | 47 | ||||
-rw-r--r-- | src/plugins/bearer/symbian/qnetworksession_impl.h | 1 |
3 files changed, 35 insertions, 19 deletions
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index 3170bf6..8013d30 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -888,12 +888,12 @@ void QNetworkSessionPrivateImpl::close() state = QNetworkSession::Closing; emit stateChanged(state); + // we fake a disconnection, session error is sent + updateState(QNetworkSession::Disconnected); + 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 { diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp index 1de4c0f..32eb61a 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp +++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp @@ -102,15 +102,14 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl() // Cancel possible RConnection::Start() Cancel(); iSocketServ.Close(); - - // Close global 'Open C' RConnection - // Clears also possible unsetdefaultif() flags. - setdefaultif(0); - + + // Restore default interface to system default + restoreDefaultIf(); + iConnectionMonitor.Close(); iOpenCLibrary.Close(); #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG - qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and setdefaultif(0))"; + qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and restoreDefaultIf())"; #endif } @@ -523,16 +522,9 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals) Cancel(); // closes iConnection iSocketServ.Close(); - - // Close global 'Open C' RConnection. If OpenC supports, - // close the defaultif for good to avoid difficult timing - // and bouncing issues of network going immediately back up - // because of e.g. select() thread etc. - if (iDynamicUnSetdefaultif) { - iDynamicUnSetdefaultif(); - } else { - setdefaultif(0); - } + + // Restore default interface to system default + restoreDefaultIf(); // If UserChoice, go down immediately. If some other configuration, // go down immediately if there is no reports expected from the platform; @@ -1457,6 +1449,29 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne } } +void QNetworkSessionPrivateImpl::restoreDefaultIf() +{ + QNetworkConfigurationPrivatePointer config = engine->defaultConfiguration(); + + QMutexLocker locker(&config->mutex); + + ifreq ifr; + memset(&ifr, 0, sizeof(ifreq)); + + switch (config->type) { + case QNetworkConfiguration::InternetAccessPoint: + strcpy(ifr.ifr_name, config->name.toUtf8().constData()); + break; + case QNetworkConfiguration::ServiceNetwork: + ifr.ifr_ifru.snap_id = toSymbianConfig(config)->numericId; + break; + default: + ; + }; + + setdefaultif(&ifr); +} + ConnectionProgressNotifier::ConnectionProgressNotifier(QNetworkSessionPrivateImpl& owner, RConnection& connection) : CActive(CActive::EPriorityUserInput), iOwner(owner), iConnection(connection) { diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h index aac9321..1b0e968 100644 --- a/src/plugins/bearer/symbian/qnetworksession_impl.h +++ b/src/plugins/bearer/symbian/qnetworksession_impl.h @@ -143,6 +143,7 @@ private: void handleSymbianConnectionStatusChange(TInt aConnectionStatus, TInt aError, TUint accessPointId = 0); QNetworkConfiguration bestConfigFromSNAP(const QNetworkConfiguration& snapConfig) const; QNetworkConfiguration activeConfiguration(TUint32 iapId = 0) const; + void restoreDefaultIf(); #ifndef QT_NO_NETWORKINTERFACE QNetworkInterface interface(TUint iapId) const; #endif |