diff options
author | Slávek Banko <[email protected]> | 2017-06-17 12:57:10 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2017-06-17 12:57:10 +0200 |
commit | e0fd34a1bd2c6412171bcceb19520d129bbcb66d (patch) | |
tree | 2043092f6f3f3c8075ea802f9e6ba1b1d543f59c | |
parent | eb6f8213d42aac2911c7b8880628c786b0223935 (diff) | |
download | tdelibs-e0fd34a1bd2c6412171bcceb19520d129bbcb66d.tar.gz tdelibs-e0fd34a1bd2c6412171bcceb19520d129bbcb66d.zip |
tdehwlib: Use TDENetworkDevice in TDENetworkConnectionManager instead of MAC address
Use interface name in TDENetworkConnectionManager_BackendNM instead of MAC address
This relates to bug 2748
The name of the network interface seems to be a more stable identifier than the MAC
address because the MAC address can be changed easily or even automatically - see
randomization of MAC addresses on wireless interfaces. Therefore, the use of the
MAC address as a network interface identifier was abandoned.
Beware, this change is an API / ABI change! However, most changes are internal
and the only one affected is application TDENetworkManager.
Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r-- | tdecore/tdehw/networkbackends/network-manager/network-manager.cpp | 157 | ||||
-rw-r--r-- | tdecore/tdehw/networkbackends/network-manager/network-manager.h | 4 | ||||
-rw-r--r-- | tdecore/tdehw/tdenetworkconnections.cpp | 24 | ||||
-rw-r--r-- | tdecore/tdehw/tdenetworkconnections.h | 23 | ||||
-rw-r--r-- | tdecore/tdehw/tdenetworkdevice.cpp | 2 |
5 files changed, 51 insertions, 159 deletions
diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp b/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp index 2a0354105..2f11dd59b 100644 --- a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp +++ b/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp @@ -1137,7 +1137,7 @@ TQString tdeIBTransportToNMIBTransport(TDENetworkInfinibandTransportMode::TDENet return ret; } -TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString macAddress) { +TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString deviceNode) { if (d->m_networkManagerProxy) { TQT_DBusObjectPathList devices; TQT_DBusError error; @@ -1148,74 +1148,15 @@ TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString m for (it = devices.begin(); it != devices.end(); ++it) { DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, (*it)); genericDevice.setConnection(TQT_DBusConnection::systemBus()); - TDENetworkDeviceType::TDENetworkDeviceType deviceType = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error)); + TQString deviceInterface = genericDevice.getInterface(error); if (error.isValid()) { // Error! PRINT_ERROR((error.name() + ": " + error.message())) break; } - else if (deviceType == TDENetworkDeviceType::WiredEthernet) { - DBus::EthernetDeviceProxy ethernetDevice(NM_DBUS_SERVICE, (*it)); - ethernetDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = ethernetDevice.getPermHwAddress(error); - if (!error.isValid()) { - if (candidateMACAddress.lower() == macAddress.lower()) { - return (*it); - } - } - } - else if (deviceType == TDENetworkDeviceType::Infiniband) { - DBus::InfinibandDeviceProxy infinibandDevice(NM_DBUS_SERVICE, (*it)); - infinibandDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = infinibandDevice.getHwAddress(error); - if (!error.isValid()) { - if (candidateMACAddress.lower() == macAddress.lower()) { - return (*it); - } - } - } - else if (deviceType == TDENetworkDeviceType::WiFi) { - DBus::WiFiDeviceProxy wiFiDevice(NM_DBUS_SERVICE, (*it)); - wiFiDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = wiFiDevice.getPermHwAddress(error); - if (!error.isValid()) { - if (candidateMACAddress.lower() == macAddress.lower()) { - return (*it); - } - } - } - else if (deviceType == TDENetworkDeviceType::WiMax) { - DBus::WiMaxDeviceProxy wiMaxDevice(NM_DBUS_SERVICE, (*it)); - wiMaxDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = wiMaxDevice.getHwAddress(error); - if (!error.isValid()) { - if (candidateMACAddress.lower() == macAddress.lower()) { - return (*it); - } - } + else if (deviceInterface == deviceNode) { + return (*it); } - else if (deviceType == TDENetworkDeviceType::OLPCMesh) { - DBus::OlpcMeshDeviceProxy olpcMeshDevice(NM_DBUS_SERVICE, (*it)); - olpcMeshDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = olpcMeshDevice.getHwAddress(error); - if (!error.isValid()) { - if (candidateMACAddress.lower() == macAddress.lower()) { - return (*it); - } - } - } - else if (deviceType == TDENetworkDeviceType::Bluetooth) { - DBus::BluetoothDeviceProxy bluetoothDevice(NM_DBUS_SERVICE, (*it)); - bluetoothDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = bluetoothDevice.getHwAddress(error); - if (!error.isValid()) { - if (candidateMACAddress.lower() == macAddress.lower()) { - return (*it); - } - } - } - // FIXME - // Add other supported device types here } return ""; } @@ -1230,72 +1171,15 @@ TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString m } } -TQString macAddressForGenericDevice(TQT_DBusObjectPath path) { +TQString tdeDeviceUUIDForGenericDevice(TQT_DBusObjectPath path) { TQT_DBusError error; - DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, path); genericDevice.setConnection(TQT_DBusConnection::systemBus()); - TQ_UINT32 deviceType = genericDevice.getDeviceType(error); + TQString deviceInterface = genericDevice.getInterface(error); if (error.isValid()) { - // Error! - PRINT_ERROR((error.name() + ": " + error.message())) - return TQString(); - } - else if (deviceType == NM_DEVICE_TYPE_ETHERNET) { - DBus::EthernetDeviceProxy ethernetDevice(NM_DBUS_SERVICE, path); - ethernetDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = ethernetDevice.getPermHwAddress(error); - if (!error.isValid()) { - return candidateMACAddress.lower(); - } - } - else if (deviceType == NM_DEVICE_TYPE_INFINIBAND) { - DBus::InfinibandDeviceProxy infinibandDevice(NM_DBUS_SERVICE, path); - infinibandDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = infinibandDevice.getHwAddress(error); - if (!error.isValid()) { - return candidateMACAddress.lower(); - } - } - else if (deviceType == NM_DEVICE_TYPE_WIFI) { - DBus::WiFiDeviceProxy wiFiDevice(NM_DBUS_SERVICE, path); - wiFiDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = wiFiDevice.getPermHwAddress(error); - if (!error.isValid()) { - return candidateMACAddress.lower(); - } - } - else if (deviceType == NM_DEVICE_TYPE_WIMAX) { - DBus::WiMaxDeviceProxy wiMaxDevice(NM_DBUS_SERVICE, path); - wiMaxDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = wiMaxDevice.getHwAddress(error); - if (!error.isValid()) { - return candidateMACAddress.lower(); - } - } - else if (deviceType == NM_DEVICE_TYPE_OLPC_MESH) { - DBus::OlpcMeshDeviceProxy olpcMeshDevice(NM_DBUS_SERVICE, path); - olpcMeshDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = olpcMeshDevice.getHwAddress(error); - if (!error.isValid()) { - return candidateMACAddress.lower(); - } - } - else if (deviceType == NM_DEVICE_TYPE_BT) { - DBus::BluetoothDeviceProxy bluetoothDevice(NM_DBUS_SERVICE, path); - bluetoothDevice.setConnection(TQT_DBusConnection::systemBus()); - TQString candidateMACAddress = bluetoothDevice.getHwAddress(error); - if (!error.isValid()) { - return candidateMACAddress.lower(); - } + return TQString::null; } - // FIXME - // Add other supported device types here - - return TQString::null; -} -TQString tdeDeviceUUIDForMACAddress(TQString macAddress) { TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); if (!hwdevices) { return TQString::null; @@ -1305,7 +1189,7 @@ TQString tdeDeviceUUIDForMACAddress(TQString macAddress) { for (TDEGenericHardwareList::iterator it = devices.begin(); it != devices.end(); ++it) { TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(*it); if (dev) { - if (macAddress.lower() == dev->macAddress().lower()) { + if (deviceInterface == dev->deviceNode()) { return dev->uniqueID(); } } @@ -1355,7 +1239,7 @@ void TDENetworkConnectionManager_BackendNM_DBusSignalReceiver::dbusSignal(const } } -TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQString macAddress) : TDENetworkConnectionManager(macAddress) { +TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice) : TDENetworkConnectionManager(networkDevice) { d = new TDENetworkConnectionManager_BackendNMPrivate(this); // Set up proxy interfaces @@ -1366,7 +1250,7 @@ TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQS d->m_vpnProxy = new DBus::VPNPluginProxy(NM_VPN_DBUS_PLUGIN_SERVICE, NM_VPN_DBUS_PLUGIN_PATH); d->m_vpnProxy->setConnection(TQT_DBusConnection::systemBus()); - d->m_dbusDeviceString = deviceInterfaceString(macAddress); + d->m_dbusDeviceString = deviceInterfaceString(deviceNode()); if (d->m_dbusDeviceString != "") { d->m_networkDeviceProxy = new DBus::DeviceProxy(NM_DBUS_SERVICE, d->m_dbusDeviceString); d->m_networkDeviceProxy->setConnection(TQT_DBusConnection::systemBus()); @@ -1618,7 +1502,7 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessDeviceStateCha m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, errorString); } - m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->m_macAddress); + m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->deviceNode()); } void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath& dbuspath) { @@ -1682,14 +1566,14 @@ void TDENetworkConnectionManager_BackendNMPrivate::internalProcessAPPropertiesCh } TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM::deviceType() { - if (m_macAddress == "") { + if (!m_networkDevice) { return TDENetworkDeviceType::BackendOnly; } else { if (d->m_dbusDeviceString != "") { // Query NM for the device type TQT_DBusError error; - d->m_dbusDeviceString = deviceInterfaceString(m_macAddress); + d->m_dbusDeviceString = deviceInterfaceString(deviceNode()); DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, d->m_dbusDeviceString); genericDevice.setConnection(TQT_DBusConnection::systemBus()); TDENetworkDeviceType::TDENetworkDeviceType ret = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error)); @@ -1981,7 +1865,7 @@ void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() { d->nonReentrantCallActive = true; TDEMACAddress deviceMACAddress; - deviceMACAddress.fromString(m_macAddress); + deviceMACAddress.fromString(this->deviceMACAddress()); if (d->m_networkManagerSettings) { clearTDENetworkConnectionList(); @@ -4953,11 +4837,11 @@ TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag if ((d->m_networkManagerSettings) && (d->m_networkManagerProxy)) { ret = d->m_networkManagerSettings->GetConnectionByUuid(uuid, existingConnection, error); if (ret) { - if (m_macAddress == "") { + if (!m_networkDevice) { d->m_dbusDeviceString = "/"; } else { - d->m_dbusDeviceString = deviceInterfaceString(m_macAddress); + d->m_dbusDeviceString = deviceInterfaceString(deviceNode()); } #ifndef USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS TQT_DBusObjectPath active_connection; @@ -5087,8 +4971,7 @@ TQStringList TDENetworkConnectionManager_BackendNM::connectionPhysicalDeviceUUID TQValueList<TQT_DBusObjectPath> deviceList = activeConnection.getDevices(error); TQT_DBusObjectPathList::iterator it2; for (it2 = deviceList.begin(); it2 != deviceList.end(); ++it2) { - TQString macAddress = macAddressForGenericDevice(*it2); - TQString devUUID = tdeDeviceUUIDForMACAddress(macAddress); + TQString devUUID = tdeDeviceUUIDForGenericDevice(*it2); if (devUUID != "") { ret.append(devUUID); } @@ -5147,11 +5030,11 @@ TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag if ((d->m_networkManagerSettings) && (d->m_networkManagerProxy)) { existingConnection = getActiveConnectionPath(uuid); if (existingConnection.isValid()) { - if (m_macAddress == "") { + if (!m_networkDevice) { d->m_dbusDeviceString = "/"; } else { - d->m_dbusDeviceString = deviceInterfaceString(m_macAddress); + d->m_dbusDeviceString = deviceInterfaceString(deviceNode()); } #ifndef USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS ret = d->m_networkManagerProxy->DeactivateConnection(existingConnection, error); @@ -5435,7 +5318,7 @@ TDENetworkHWNeighborList* TDENetworkConnectionManager_BackendNM::siteSurvey() { bool ret; TDENetworkDeviceType::TDENetworkDeviceType myDeviceType = deviceType(); - d->m_dbusDeviceString = deviceInterfaceString(m_macAddress); + d->m_dbusDeviceString = deviceInterfaceString(deviceNode()); clearTDENetworkHWNeighborList(); if (myDeviceType == TDENetworkDeviceType::WiFi) { diff --git a/tdecore/tdehw/networkbackends/network-manager/network-manager.h b/tdecore/tdehw/networkbackends/network-manager/network-manager.h index 0de184706..92b4b0a37 100644 --- a/tdecore/tdehw/networkbackends/network-manager/network-manager.h +++ b/tdecore/tdehw/networkbackends/network-manager/network-manager.h @@ -213,7 +213,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo Q_OBJECT public: - TDENetworkConnectionManager_BackendNM(TQString macAddress); + TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice); ~TDENetworkConnectionManager_BackendNM(); virtual TQString backendName(); @@ -249,7 +249,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo private: TDENetworkDeviceType::TDENetworkDeviceType nmDeviceTypeToTDEDeviceType(TQ_UINT32 nmType); - TQString deviceInterfaceString(TQString macAddress); + TQString deviceInterfaceString(TQString deviceNode); bool loadConnectionSecretsForGroup(TQString uuid, TQString group); TDENetworkWiFiAPInfo* getAccessPointDetails(TQString dbusPath); TDENetworkConnectionType::TDENetworkConnectionType connectionType(TQString dbusPath); 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))); diff --git a/tdecore/tdehw/tdenetworkconnections.h b/tdecore/tdehw/tdenetworkconnections.h index 7cc6bae6c..806c162a8 100644 --- a/tdecore/tdehw/tdenetworkconnections.h +++ b/tdecore/tdehw/tdenetworkconnections.h @@ -1003,7 +1003,7 @@ class TDENetworkEventQueueEvent_Private TDENetworkConnectionStatus::TDENetworkConnectionStatus previousConnStatus; TDEMACAddress BSSID; TQString message; - TQString hwAddress; + TQString deviceNode; TDENetworkAPEventType::TDENetworkAPEventType apevent; TDENetworkDeviceEventType::TDENetworkDeviceEventType ndevent; TDENetworkVPNEventType::TDENetworkVPNEventType vpnevent; @@ -1020,12 +1020,12 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject public: /** * Constructor. - * @param macAddress The MAC address of the hardware device - * If an empty MAC address is passed, this object will make global networking backend + * @param networkDevice Pointer to holder network device + * If the network device is passed null, this object will make global networking backend * methods available exclusively (TDENetworkDeviceType::BackendOnly). */ - TDENetworkConnectionManager(TQString macAddress); - + TDENetworkConnectionManager(TDENetworkDevice *networkDevice); + /** * Destructor. */ @@ -1209,7 +1209,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject * If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address * of the networking hardware that has changed state. */ - void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress); + void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString deviceNode); /** * Emitted whenever the status of a wireless access point changes @@ -1254,6 +1254,11 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject virtual TDENetworkConnectionList* connections(); /** + * @return the interface name of this device + */ + TQString deviceNode(); + + /** * @return the MAC address of this device */ TQString deviceMACAddress(); @@ -1318,7 +1323,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject * @internal This method must be called by the network backend whenever a device changes state * It emits the appropriate signals to notify client applications of the state change */ - void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null); + void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString deviceNode=TQString::null); /** * @internal This method must be called by the network backend whenever a wireless access point changes state @@ -1350,7 +1355,7 @@ class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject protected: TDENetworkConnectionList* m_connectionList; TDENetworkHWNeighborList* m_hwNeighborList; - TQString m_macAddress; + TDENetworkDevice* m_networkDevice; TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags m_prevConnectionStatus; TQMap<TQString, TDENetworkConnectionStatus::TDENetworkConnectionStatus> m_prevDeviceStatus; TQTimer* m_emissionTimer; @@ -1528,7 +1533,7 @@ class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject * If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address * of the networking hardware that has changed state. */ - void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress); + void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString deviceNode); /** * Emitted whenever the status of a wireless access point changes diff --git a/tdecore/tdehw/tdenetworkdevice.cpp b/tdecore/tdehw/tdenetworkdevice.cpp index f49eca9e6..ad4b71a6b 100644 --- a/tdecore/tdehw/tdenetworkdevice.cpp +++ b/tdecore/tdehw/tdenetworkdevice.cpp @@ -174,7 +174,7 @@ void TDENetworkDevice::internalSetTxPackets(double tx) { TDENetworkConnectionManager* TDENetworkDevice::connectionManager() { #ifdef WITH_NETWORK_MANAGER_BACKEND if (!m_connectionManager) { - m_connectionManager = new TDENetworkConnectionManager_BackendNM(m_macAddress); + m_connectionManager = new TDENetworkConnectionManager_BackendNM(this); } #endif // WITH_NETWORK_MANAGER_BACKEND |