Use interface name instead of MAC address

This relates to API / ABI change in tdelibs
This relates to bug 2748

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 954f1c91e7)
r14.0.x
Slávek Banko 8 years ago
parent e812d24dd6
commit f7b0afaffb

@ -205,7 +205,7 @@ void DeviceTrayComponent::setPixmapForState(TDENetworkConnectionStatus::TDENetwo
m_pixmaps[state] = pixmap; m_pixmaps[state] = pixmap;
} }
void DeviceTrayComponent::deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString hwAddress) void DeviceTrayComponent::deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString deviceNode)
{ {
lastKnownState = newState; lastKnownState = newState;
@ -213,8 +213,8 @@ void DeviceTrayComponent::deviceStateChanged(TDENetworkConnectionStatus::TDENetw
TDEGlobalNetworkManager* nm = TDEGlobal::networkManager(); TDEGlobalNetworkManager* nm = TDEGlobal::networkManager();
TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(m_device)); TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(m_device));
if (dev->macAddress() != hwAddress) { if (dev->deviceNode() != deviceNode) {
kdDebug() << k_funcinfo << "WARNING: Got networkDeviceStateChanged signal for HW address '" << hwAddress << "', but my HW address is '" << dev->macAddress() << "'! Ignoring..."; kdDebug() << k_funcinfo << "WARNING: Got networkDeviceStateChanged signal for interface '" << deviceNode << "', but my interface is '" << dev->deviceNode() << "'! Ignoring...";
return; return;
} }

@ -681,7 +681,7 @@ void Tray::slotUpdateDeviceState()
// FIXME // FIXME
} }
void Tray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString hwAddress) void Tray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString deviceNode)
{ {
#ifdef DEBUG_STATE #ifdef DEBUG_STATE
printf("Device state: 0x%08x was: 0x%08x\n", newState, prevState); printf("Device state: 0x%08x was: 0x%08x\n", newState, prevState);

@ -95,7 +95,7 @@ class Tray : public KSystemTray
void slotStateChangedNotify(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags prevState); void slotStateChangedNotify(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags newState, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags prevState);
void slotUpdateDeviceState(); void slotUpdateDeviceState();
void slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString hwAddress); void slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString deviceNode);
void slotNewVPNConnection(); void slotNewVPNConnection();
void slotVPNBannerShow(const TQString& vpnbanner); void slotVPNBannerShow(const TQString& vpnbanner);

@ -305,12 +305,12 @@ void WirelessDeviceTray::setPixmapForStates(TDENetworkConnectionStatus::TDENetwo
} }
} }
void WirelessDeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString hwAddress) void WirelessDeviceTray::slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus prevState, TQString deviceNode)
{ {
TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev)); TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
if (dev->macAddress() != hwAddress) { if (dev->deviceNode() != deviceNode) {
kdDebug() << k_funcinfo << "WARNING: Got networkDeviceStateChanged signal for HW address '" << hwAddress << "', but my HW address is '" << dev->macAddress() << "'! Ignoring..."; kdDebug() << k_funcinfo << "WARNING: Got networkDeviceStateChanged signal for interface '" << deviceNode << "', but my interface is '" << dev->deviceNode() << "'! Ignoring...";
return; return;
} }
@ -439,7 +439,7 @@ void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEv
// force status update to ensure correct icon is shown on startup // force status update to ensure correct icon is shown on startup
if ((dev) && (deviceConnMan)) { if ((dev) && (deviceConnMan)) {
slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags, TDENetworkConnectionStatus::Invalid, dev->macAddress()); slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags, TDENetworkConnectionStatus::Invalid, dev->deviceNode());
} }
} }
} }

Loading…
Cancel
Save