From 86febbf35190d680a61af4676704c5ece8a9de98 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 4 Sep 2012 15:19:10 -0500 Subject: Add connection to device lookup routines --- .../network-manager/network-manager.cpp | 35 ++++++++++++++++++++++ .../network-manager/network-manager.h | 1 + 2 files changed, 36 insertions(+) (limited to 'tdecore/networkbackends') diff --git a/tdecore/networkbackends/network-manager/network-manager.cpp b/tdecore/networkbackends/network-manager/network-manager.cpp index 57ae8672d..ea962367b 100644 --- a/tdecore/networkbackends/network-manager/network-manager.cpp +++ b/tdecore/networkbackends/network-manager/network-manager.cpp @@ -3965,6 +3965,41 @@ TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag } } +TQStringList TDENetworkConnectionManager_BackendNM::connectionPhysicalDeviceUUIDs(TQString uuid) { + if (deviceType() == TDENetworkDeviceType::BackendOnly) { + return TQStringList(); + } + + TQT_DBusObjectPath existingConnection; + TQT_DBusError error; + if (d->m_networkManagerProxy) { + TQT_DBusObjectPathList activeConnections = d->m_networkManagerProxy->getActiveConnections(error); + TQT_DBusObjectPathList::iterator it; + TQStringList ret; + for (it = activeConnections.begin(); it != activeConnections.end(); ++it) { + DBus::ActiveConnectionProxy activeConnection(NM_DBUS_SERVICE, (*it)); + activeConnection.setConnection(TQT_DBusConnection::systemBus()); + if (activeConnection.getUuid(error) == uuid) { + TQValueList deviceList = activeConnection.getDevices(error); + TQT_DBusObjectPathList::iterator it2; + for (it2 = deviceList.begin(); it2 != deviceList.end(); ++it2) { + DBus::DeviceProxy underlyingNetworkDeviceProxy(NM_DBUS_SERVICE, *it2); + underlyingNetworkDeviceProxy.setConnection(TQT_DBusConnection::systemBus()); + TQString devUUID = underlyingNetworkDeviceProxy.getUdi(error); + if (devUUID != "") { + ret.append(devUUID); + } + } + } + } + return ret; + } + else { + PRINT_ERROR(TQString("invalid internal network-manager settings proxy object").arg(uuid)); + return TQStringList(); + } +} + TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManager_BackendNM::deactivateConnection(TQString uuid) { TQT_DBusObjectPath existingConnection; TQT_DBusError error; diff --git a/tdecore/networkbackends/network-manager/network-manager.h b/tdecore/networkbackends/network-manager/network-manager.h index ef878bb00..d0b2df302 100644 --- a/tdecore/networkbackends/network-manager/network-manager.h +++ b/tdecore/networkbackends/network-manager/network-manager.h @@ -139,6 +139,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo virtual TDENetworkConnectionStatus::TDENetworkConnectionStatus deactivateConnection(TQString uuid); virtual TDENetworkHWNeighborList* siteSurvey(); + virtual TQStringList connectionPhysicalDeviceUUIDs(TQString uuid); virtual bool networkingEnabled(); virtual bool wiFiHardwareEnabled(); -- cgit v1.2.1