summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdenetworkconnections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdecore/tdehw/tdenetworkconnections.cpp')
-rw-r--r--tdecore/tdehw/tdenetworkconnections.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/tdecore/tdehw/tdenetworkconnections.cpp b/tdecore/tdehw/tdenetworkconnections.cpp
index dec04e86b..7cef67cf3 100644
--- a/tdecore/tdehw/tdenetworkconnections.cpp
+++ b/tdecore/tdehw/tdenetworkconnections.cpp
@@ -698,7 +698,7 @@ TDEWiFiConnection::~TDEWiFiConnection() {
/* TDENetworkConnectionManager */
/*================================================================================================*/
-TDENetworkConnectionManager::TDENetworkConnectionManager(TQString macAddress) : TQObject(), m_connectionList(NULL), m_hwNeighborList(NULL), m_macAddress(macAddress), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
+TDENetworkConnectionManager::TDENetworkConnectionManager(TDENetworkDevice *networkDevice) : TQObject(), m_connectionList(NULL), m_hwNeighborList(NULL), m_networkDevice(networkDevice), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
m_emissionTimer = new TQTimer();
connect(m_emissionTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(emitQueuedSignals()));
if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, TRUE);
@@ -709,8 +709,12 @@ TDENetworkConnectionManager::~TDENetworkConnectionManager() {
delete m_emissionTimer;
}
+TQString TDENetworkConnectionManager::deviceNode() {
+ return m_networkDevice ? m_networkDevice->deviceNode() : TQString();
+}
+
TQString TDENetworkConnectionManager::deviceMACAddress() {
- return m_macAddress;
+ return m_networkDevice ? m_networkDevice->macAddress() : TQString();
}
TDENetworkConnectionList* TDENetworkConnectionManager::connections() {
@@ -856,20 +860,20 @@ void TDENetworkConnectionManager::internalNetworkConnectionStateChanged(TDENetwo
m_prevConnectionStatus = newState;
}
-void TDENetworkConnectionManager::internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress) {
- if (!m_prevDeviceStatus.contains(hwAddress)) {
- m_prevDeviceStatus[hwAddress] = TDENetworkConnectionStatus::Invalid;
+void TDENetworkConnectionManager::internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString deviceNodeName) {
+ if (!m_prevDeviceStatus.contains(deviceNodeName)) {
+ m_prevDeviceStatus[deviceNodeName] = TDENetworkConnectionStatus::Invalid;
}
TDENetworkEventQueueEvent_Private queuedEvent;
queuedEvent.eventType = 1;
queuedEvent.newConnStatus = newState;
- queuedEvent.previousConnStatus = m_prevDeviceStatus[hwAddress];
- queuedEvent.hwAddress = hwAddress;
+ queuedEvent.previousConnStatus = m_prevDeviceStatus[deviceNodeName];
+ queuedEvent.deviceNode = deviceNodeName;
m_globalEventQueueEventList.append(queuedEvent);
if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, TRUE);
- m_prevDeviceStatus[hwAddress] = newState;
+ m_prevDeviceStatus[deviceNodeName] = newState;
}
void TDENetworkConnectionManager::internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) {
@@ -921,7 +925,7 @@ void TDENetworkConnectionManager::emitQueuedSignals() {
emit(networkConnectionStateChanged(event.newState, event.previousState));
}
else if (event.eventType == 1) {
- emit(networkDeviceStateChanged(event.newConnStatus, event.previousConnStatus, event.hwAddress));
+ emit(networkDeviceStateChanged(event.newConnStatus, event.previousConnStatus, event.deviceNode));
}
else if (event.eventType == 2) {
emit(accessPointStatusChanged(event.BSSID, event.apevent));
@@ -948,7 +952,7 @@ void TDENetworkConnectionManager::emitQueuedSignals() {
TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager(NULL) {
#ifdef WITH_NETWORK_MANAGER_BACKEND
- m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(TQString::null);
+ m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(NULL);
#endif // WITH_NETWORK_MANAGER_BACKEND
if (m_internalConnectionManager) {
connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));