summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/corewlan
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2010-03-26 01:07:36 (GMT)
committerLorn Potter <lorn.potter@nokia.com>2010-03-26 01:07:36 (GMT)
commit6f9eb6f97bdace74111180bc548f21f613e2674c (patch)
tree970dee9f6b24092cb2597ef2389137a9b10ac876 /src/plugins/bearer/corewlan
parent3343298448da3f2546b0708670effb798f762c5c (diff)
downloadQt-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/corewlan')
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.h2
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm20
2 files changed, 17 insertions, 5 deletions
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h
index 5e93193..11f5d96 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.h
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.h
@@ -102,7 +102,7 @@ protected:
void getUserConfigurations();
QString getNetworkNameFromSsid(const QString &ssid);
QString getSsidFromNetworkName(const QString &name);
- QStringList foundNetwork(const QString &id, const QString &ssid, const QNetworkConfiguration::StateFlags state, const QString &interfaceName);
+ QStringList foundNetwork(const QString &id, const QString &ssid, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose);
};
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index a366d00..b59ccee 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -271,7 +271,7 @@ void QCoreWlanEngine::connectToId(const QString &id)
SecKeychainAttributeList attributeList = {3,attributes};
SecKeychainSearchRef searchRef;
- OSErr result = SecKeychainSearchCreateFromAttributes(NULL, kSecGenericPasswordItemClass, &attributeList, &searchRef);
+ SecKeychainSearchCreateFromAttributes(NULL, kSecGenericPasswordItemClass, &attributeList, &searchRef);
NSString *password = @"";
SecKeychainItemRef searchItem;
@@ -429,7 +429,14 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName)
state = QNetworkConfiguration::Undefined;
}
}
- found.append(foundNetwork(id, networkSsid, state, interfaceName));
+ QNetworkConfiguration::Purpose purpose = QNetworkConfiguration::UnknownPurpose;
+ if([[apNetwork securityMode] intValue] == kCWSecurityModeOpen) {
+ purpose = QNetworkConfiguration::PublicPurpose;
+ } else {
+ purpose = QNetworkConfiguration::PrivatePurpose;
+ }
+
+ found.append(foundNetwork(id, networkSsid, state, interfaceName, purpose));
} //end row
} //end error
@@ -470,13 +477,13 @@ QStringList QCoreWlanEngine::scanForSsids(const QString &interfaceName)
state = QNetworkConfiguration::Defined;
}
- found.append(foundNetwork(id, networkName, state, interfaceName));
+ found.append(foundNetwork(id, networkName, state, interfaceName, QNetworkConfiguration::UnknownPurpose));
}
}
return found;
}
-QStringList QCoreWlanEngine::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName)
+QStringList QCoreWlanEngine::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose)
{
QStringList found;
QMutexLocker locker(&mutex);
@@ -507,6 +514,10 @@ QStringList QCoreWlanEngine::foundNetwork(const QString &id, const QString &name
changed = true;
}
+ if (ptr->purpose != purpose) {
+ ptr->purpose = purpose;
+ changed = true;
+ }
ptr->mutex.unlock();
if (changed) {
@@ -524,6 +535,7 @@ QStringList QCoreWlanEngine::foundNetwork(const QString &id, const QString &name
ptr->state = state;
ptr->type = QNetworkConfiguration::InternetAccessPoint;
ptr->bearer = QLatin1String("WLAN");
+ ptr->purpose = purpose;
accessPointConfigurations.insert(ptr->id, ptr);
configurationInterface.insert(ptr->id, interfaceName);