diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2010-03-26 01:07:36 (GMT) |
---|---|---|
committer | Lorn Potter <lorn.potter@nokia.com> | 2010-03-26 01:07:36 (GMT) |
commit | 6f9eb6f97bdace74111180bc548f21f613e2674c (patch) | |
tree | 970dee9f6b24092cb2597ef2389137a9b10ac876 /src/plugins/bearer/networkmanager | |
parent | 3343298448da3f2546b0708670effb798f762c5c (diff) | |
download | Qt-6f9eb6f97bdace74111180bc548f21f613e2674c.zip Qt-6f9eb6f97bdace74111180bc548f21f613e2674c.tar.gz Qt-6f9eb6f97bdace74111180bc548f21f613e2674c.tar.bz2 |
specify the configuration's purpose based on security mode of network.
open is public.
Diffstat (limited to 'src/plugins/bearer/networkmanager')
-rw-r--r-- | src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 28ee38e..72d6838 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -602,7 +602,11 @@ void QNetworkManagerEngine::newAccessPoint(const QString &path, const QDBusObjec ptr->isValid = true; ptr->id = QString::number(qHash(objectPath.path())); ptr->type = QNetworkConfiguration::InternetAccessPoint; - ptr->purpose = QNetworkConfiguration::PublicPurpose; + if(accessPoint->flags() == NM_802_11_AP_FLAGS_PRIVACY) { + ptr->purpose = QNetworkConfiguration::PrivatePurpose; + } else { + ptr->purpose = QNetworkConfiguration::PublicPurpose; + } ptr->state = QNetworkConfiguration::Undefined; ptr->bearer = QLatin1String("WLAN"); @@ -718,6 +722,7 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri if (connectionType == QLatin1String("802-3-ethernet")) { cpPriv->bearer = QLatin1String("Ethernet"); + cpPriv->purpose = QNetworkConfiguration::PublicPurpose; foreach (const QDBusObjectPath &devicePath, interface->getDevices()) { QNetworkManagerInterfaceDevice device(devicePath.path()); @@ -734,7 +739,12 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri cpPriv->bearer = QLatin1String("WLAN"); const QString connectionSsid = map.value("802-11-wireless").value("ssid").toString(); - + const QString connectionSecurity = map.value("802-11-wireless").value("security").toString(); + if(!connectionSecurity.isEmpty()) { + cpPriv->purpose = QNetworkConfiguration::PrivatePurpose; + } else { + cpPriv->purpose = QNetworkConfiguration::PublicPurpose; + } for (int i = 0; i < accessPoints.count(); ++i) { if (connectionSsid == accessPoints.at(i)->ssid()) { cpPriv->state |= QNetworkConfiguration::Discovered; |