summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tdecore/networkbackends/network-manager/network-manager.cpp20
-rw-r--r--tdecore/tdenetworkconnections.cpp36
-rw-r--r--tdecore/tdenetworkconnections.h2
3 files changed, 47 insertions, 11 deletions
diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp
index a46144ea2..1b639aa25 100644
--- a/tdecore/networkbackends/network-manager/network-manager.cpp
+++ b/tdecore/networkbackends/network-manager/network-manager.cpp
@@ -1532,6 +1532,10 @@ void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() {
TDENetworkIPConfigurationFlags::IPV6DHCPRoutes | \
TDENetworkIPConfigurationFlags::IPV6MayUseAsDefaultRoute;
+ if (wiFiConnection) {
+ wiFiConnection->securitySettings.authType = TDENetworkWiFiAuthType::Open;
+ }
+
#ifdef DEBUG_NETWORK_MANAGER_COMMUNICATIONS
printf("[network-manager comm debug] %s\n\r", (*it).data()); fflush(stdout);
#endif // DEBUG_NETWORK_MANAGER_COMMUNICATIONS
@@ -3321,7 +3325,12 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
}
}
{
- settingsMap["hidden"] = convertDBUSDataToVariantData(TQT_DBusData::fromBool(wiFiConnection->isHiddenNetwork));
+ if (wiFiConnection->isHiddenNetwork) {
+ settingsMap["hidden"] = convertDBUSDataToVariantData(TQT_DBusData::fromBool(true));
+ }
+ else {
+ settingsMap.remove("hidden");
+ }
}
}
dbusData = TQT_DBusData::fromStringKeyMap(TQT_DBusDataMap<TQString>(settingsMap));
@@ -3348,14 +3357,7 @@ bool TDENetworkConnectionManager_BackendNM::saveConnection(TDENetworkConnection*
else {
settingsMap.remove("wep-tx-keyidx");
}
- {
- if (wiFiConnection->securityRequired) {
- settingsMap["auth-alg"] = convertDBUSDataToVariantData(TQT_DBusData::fromString(tdeWiFiAuthTypeToNMWiFiAuthType(wiFiConnection->securitySettings.authType)));
- }
- else {
- settingsMap.remove("auth-alg");
- }
- }
+ UPDATE_STRING_SETTING_IF_VALID(tdeWiFiAuthTypeToNMWiFiAuthType(wiFiConnection->securitySettings.authType), "auth-alg", settingsMap)
{
TQT_DBusDataValueList valueList;
{
diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp
index 6139bd49f..9b435b2ac 100644
--- a/tdecore/tdenetworkconnections.cpp
+++ b/tdecore/tdenetworkconnections.cpp
@@ -247,6 +247,24 @@ bool operator==(const TDEMACAddress &a1, const TDEMACAddress &a2) {
}
}
+bool operator<(const TDEMACAddress &a1, const TDEMACAddress &a2) {
+ if (a1.m_macAddress.count() < a2.m_macAddress.count()) {
+ return true;
+ }
+ else {
+ unsigned int i;
+ for (i=0; i<a1.m_macAddress.count(); i++) {
+ if (a1.m_macAddress[i] < a2.m_macAddress[i]) {
+ return true;
+ }
+ if (a1.m_macAddress[i] > a2.m_macAddress[i]) {
+ return false;
+ }
+ }
+ return false;
+ }
+}
+
/*================================================================================================*/
/* TDENetworkSingleIPConfiguration */
/*================================================================================================*/
@@ -923,8 +941,22 @@ TDENetworkDevice* TDEGlobalNetworkManager::findDeviceByUUID(TQString uuid) {
}
TDENetworkWiFiAPInfo* TDEGlobalNetworkManager::findAccessPointByBSSID(TDEMACAddress bssid) {
- if (!m_internalConnectionManager) return NULL;
- return m_internalConnectionManager->findAccessPointByBSSID(bssid);
+ TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices();
+ if (!hwdevices) {
+ return NULL;
+ }
+
+ TDENetworkWiFiAPInfo* ret = NULL;
+ TDEGenericHardwareList devices = hwdevices->listByDeviceClass(TDEGenericDeviceType::Network);
+ for (TDEGenericHardwareList::iterator it = devices.begin(); it != devices.end(); ++it) {
+ TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(*it);
+ if (dev) {
+ TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
+ ret = deviceConnMan->findAccessPointByBSSID(bssid);
+ }
+ }
+
+ return ret;
}
/*================================================================================================*/
diff --git a/tdecore/tdenetworkconnections.h b/tdecore/tdenetworkconnections.h
index 56e950fed..04a9e1c79 100644
--- a/tdecore/tdenetworkconnections.h
+++ b/tdecore/tdenetworkconnections.h
@@ -504,9 +504,11 @@ class TDECORE_EXPORT TDEMACAddress
TDENetworkByteList m_macAddress;
friend bool operator==(const TDEMACAddress &a1, const TDEMACAddress &a2);
+ friend bool operator<(const TDEMACAddress &a1, const TDEMACAddress &a2);
};
TDECORE_EXPORT bool operator==(const TDEMACAddress &a1, const TDEMACAddress &a2);
+TDECORE_EXPORT bool operator<(const TDEMACAddress &a1, const TDEMACAddress &a2);
typedef TQValueList<TDEMACAddress> TDEMACAddressList;