diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-04 15:19:10 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-04 15:19:10 -0500 |
commit | 86febbf35190d680a61af4676704c5ece8a9de98 (patch) | |
tree | 343bfd3d767058240e1c9963b0e5b1231c8c47bf /tdecore/networkbackends | |
parent | 50a9b042eef60a6531b7fbb3c467342ac592d9e3 (diff) | |
download | tdelibs-86febbf35190d680a61af4676704c5ece8a9de98.tar.gz tdelibs-86febbf35190d680a61af4676704c5ece8a9de98.zip |
Add connection to device lookup routines
Diffstat (limited to 'tdecore/networkbackends')
-rw-r--r-- | tdecore/networkbackends/network-manager/network-manager.cpp | 35 | ||||
-rw-r--r-- | tdecore/networkbackends/network-manager/network-manager.h | 1 |
2 files changed, 36 insertions, 0 deletions
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<TQT_DBusObjectPath> 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(); |