summaryrefslogtreecommitdiffstats
path: root/tdecore/tdenetworkconnections.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-09-04 15:19:10 -0500
committerTimothy Pearson <[email protected]>2012-09-04 15:19:10 -0500
commit86febbf35190d680a61af4676704c5ece8a9de98 (patch)
tree343bfd3d767058240e1c9963b0e5b1231c8c47bf /tdecore/tdenetworkconnections.cpp
parent50a9b042eef60a6531b7fbb3c467342ac592d9e3 (diff)
downloadtdelibs-86febbf35190d680a61af4676704c5ece8a9de98.tar.gz
tdelibs-86febbf35190d680a61af4676704c5ece8a9de98.zip
Add connection to device lookup routines
Diffstat (limited to 'tdecore/tdenetworkconnections.cpp')
-rw-r--r--tdecore/tdenetworkconnections.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp
index 71132825e..d9f4b5d97 100644
--- a/tdecore/tdenetworkconnections.cpp
+++ b/tdecore/tdenetworkconnections.cpp
@@ -635,6 +635,27 @@ TDENetworkConnection* TDENetworkConnectionManager::findConnectionByUUID(TQString
return NULL;
}
+TDENetworkDevice* TDENetworkConnectionManager::findDeviceByUUID(TQString uuid) {
+ TDEHardwareDevices *hwdevices = KGlobal::hardwareDevices();
+ if (!hwdevices) return 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* deviceConnectionManager = dev->connectionManager();
+ if (deviceConnectionManager) {
+ if (deviceConnectionManager->deviceInformation().UUID == uuid) {
+ return dev;
+ }
+ }
+ }
+ }
+
+ return NULL;
+}
+
void TDENetworkConnectionManager::clearTDENetworkConnectionList() {
TDENetworkConnection *connection;
for (connection = m_connectionList->first(); connection; connection = m_connectionList->next()) {
@@ -724,6 +745,11 @@ TDENetworkHWNeighborList* TDEGlobalNetworkManager::siteSurvey() {
return m_internalConnectionManager->siteSurvey();
}
+TQStringList TDEGlobalNetworkManager::connectionPhysicalDeviceUUIDs(TQString uuid) {
+ if (!m_internalConnectionManager) return TQStringList();
+ return m_internalConnectionManager->connectionPhysicalDeviceUUIDs(uuid);
+}
+
bool TDEGlobalNetworkManager::networkingEnabled() {
if (!m_internalConnectionManager) return false;
return m_internalConnectionManager->networkingEnabled();
@@ -759,6 +785,11 @@ TDENetworkConnection* TDEGlobalNetworkManager::findConnectionByUUID(TQString uui
return m_internalConnectionManager->findConnectionByUUID(uuid);
}
+TDENetworkDevice* TDEGlobalNetworkManager::findDeviceByUUID(TQString uuid) {
+ if (!m_internalConnectionManager) return NULL;
+ return m_internalConnectionManager->findDeviceByUUID(uuid);
+}
+
/*================================================================================================*/
/* End */
/*================================================================================================*/