Thanks to that UI doesn't display connections that cannot be used on specified
interface.
BUG: 298974
Signed-off-by: Sebastian Krzyszkowiak
---
.../service/networkinterfaceactivatableprovider.cpp | 19 +++
libs/service/networkinterfaceactivatableprovider.h |1 +
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/libs/service/networkinterfaceactivatableprovider.cpp
b/libs/service/networkinterfaceactivatableprovider.cpp
index 1d41432..fd33930 100644
--- a/libs/service/networkinterfaceactivatableprovider.cpp
+++ b/libs/service/networkinterfaceactivatableprovider.cpp
@@ -148,6 +148,19 @@ bool
NetworkInterfaceActivatableProvider::matches(Knm::Connection::Type connType
); /* TODO: implement Bluetooth Cdma, Wimax, LTE */
}
+QString NetworkInterfaceActivatableProvider::macByteArrayToString(QByteArray
array) {
+QString mac = "";
+for (int i=0; itype() == Knm::Connection::Wired) {
Knm::WiredSetting * wiredSetting = dynamic_cast(connection->setting(Knm::Setting::Wired));
Solid::Control::WiredNetworkInterfaceNm09 * wiredIface =
dynamic_cast(iface);
@@ -165,7 +177,7 @@ bool
NetworkInterfaceActivatableProvider::hardwareAddressMatches(Knm::Connection
// only settings which contain a valid macaddress are interesting
if (!wiredSetting->macaddress().isEmpty()) {
-matches = (QString(wiredSetting->macaddress()) ==
wiredIface->hardwareAddress());
+matches = (macByteArrayToString(wiredSetting->macaddress()) ==
wiredIface->hardwareAddress());
}
}
} else if (connection->type() == Knm::Connection::Wireless) {
@@ -176,11 +188,10 @@ bool
NetworkInterfaceActivatableProvider::hardwareAddressMatches(Knm::Connection
// only settings which contain a valid macaddress are interesting
if (!wirelessSetting->macaddress().isEmpty()) {
-matches = (QString(wirelessSetting->macaddress()) ==
wirelessIface->hardwareAddress());
+matches = (macByteArrayToString(wirelessSetting->macaddress())
== wirelessIface->hardwareAddress());
}
}
}
-#endif
return matches;
}
diff --git a/libs/service/networkinterfaceactivatableprovider.h
b/libs/service/networkinterfaceactivatableprovider.h
index 9dc995f..d11a006 100644
--- a/libs/service/networkinterfaceactivatableprovider.h
+++ b/libs/service/networkinterfaceactivatableprovider.h
@@ -62,6 +62,7 @@ class KNM_EXPORT NetworkInterfaceActivatableProvider : public
QObject, virtual p
{
Q_OBJECT
public:
+static QString macByteArrayToString(QByteArray array);
static bool hardwareAddressMatches(Knm::Connection * connection,
Solid::Control::NetworkInterfaceNm09 * iface);
static bool matches(Knm::Connection::Type connType,
Solid::Control::NetworkInterfaceNm09::Type ifaceType,
Solid::Control::ModemNetworkInterfaceNm09::ModemCapabilities modemCaps =
Solid::Control::ModemNetworkInterfaceNm09::None);
--
1.7.10.4
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<