summaryrefslogtreecommitdiffstats
path: root/arch/tde-extra/tde-tdenetworkmanager/bp001-e4e7853030.diff
blob: 887c989f16db3ed5c0e336533672343f9eafc144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
commit e4e7853030d8efbf14e5ad6631c4cfb6b3601269
Author: Michele Calgaro <michele.calgaro@yahoo.it>
Date:   Mon Aug 2 23:19:04 2021 +0900

    Removed unused hardwareEvent code - part 2.
    
    Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>

diff --git a/tdenetworkmanager/src/devicetraycomponent.cpp b/tdenetworkmanager/src/devicetraycomponent.cpp
index 085435c..2ea4e35 100644
--- a/tdenetworkmanager/src/devicetraycomponent.cpp
+++ b/tdenetworkmanager/src/devicetraycomponent.cpp
@@ -75,7 +75,11 @@ DeviceTrayComponent::DeviceTrayComponent(TQString device, KSystemTray * parent,
 	TDEHardwareDevices* hwdevices = TDEGlobal::hardwareDevices();
 
 	// Trigger an initial hardware information update
-	tdeHardwareEventHandler(TDEHardwareEvent::HardwareListModified, TQString::null);
+	TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(m_device));
+	TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
+
+	connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), TQT_SLOT(deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
+	connect(deviceConnMan, TQT_SIGNAL(networkDeviceEvent(TDENetworkDeviceEventType::TDENetworkDeviceEventType, TQString)), this, TQT_SLOT(deviceEventHandler(TDENetworkDeviceEventType::TDENetworkDeviceEventType, TQString)));
 
 	m_pixmaps[TDENetworkConnectionStatus::Invalid] = "nm_no_connection";
 	m_pixmaps[TDENetworkConnectionStatus::UnManaged] = "nm_no_connection";
@@ -110,18 +114,6 @@ TQString DeviceTrayComponent::device() const
 	return m_device;
 }
 
-void DeviceTrayComponent::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent event, TQString)
-{
-	if (event == TDEHardwareEvent::HardwareListModified) {
-		TDEHardwareDevices* hwdevices = TDEGlobal::hardwareDevices();
-		TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(m_device));
-		TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
-
-		connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), TQT_SLOT(deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
-		connect(deviceConnMan, TQT_SIGNAL(networkDeviceEvent(TDENetworkDeviceEventType::TDENetworkDeviceEventType, TQString)), this, TQT_SLOT(deviceEventHandler(TDENetworkDeviceEventType::TDENetworkDeviceEventType, TQString)));
-	}
-}
-
 void DeviceTrayComponent::deviceEventHandler(TDENetworkDeviceEventType::TDENetworkDeviceEventType event, TQString message) {
 	kdDebug() << "DeviceTrayComponent::deviceEventHandler" << endl;
 
diff --git a/tdenetworkmanager/src/devicetraycomponent.h b/tdenetworkmanager/src/devicetraycomponent.h
index af0ccea..c3c40e1 100644
--- a/tdenetworkmanager/src/devicetraycomponent.h
+++ b/tdenetworkmanager/src/devicetraycomponent.h
@@ -59,7 +59,6 @@ class DeviceTrayComponent : public TrayComponent
 		void deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString);
 
 	private slots:
-		void tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent, TQString);
 		void deviceEventHandler(TDENetworkDeviceEventType::TDENetworkDeviceEventType event, TQString message);
 
 	protected:
diff --git a/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp b/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp
index 9b855ec..8811650 100644
--- a/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp
+++ b/tdenetworkmanager/src/tdenetman-wireless_device_tray.cpp
@@ -428,25 +428,6 @@ void WirelessDeviceTray::slotAccessPointRemoved(TDEMACAddress)
 	KNotifyClient::event( tray()->winId(), "tdenm-nm-network-gone", i18n("TDENetworkManager Wireless Network Disappeared") );
 }
 
-void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent event, TQString)
-{
-	if (event == TDEHardwareEvent::HardwareListModified) {
-		TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
-		TDENetworkConnectionManager* deviceConnMan = (dev)?dev->connectionManager():NULL;
-
-		// get notified when the device state changes
-		connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
-	
-		// get notified of all AP changes
-		connect(deviceConnMan, TQT_SIGNAL(accessPointStatusChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)), this, TQT_SLOT(tdeAccessPointStatusChangedHandler(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)));
-
-		// force status update to ensure correct icon is shown on startup
-		if ((dev) && (deviceConnMan)) {
-			slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags, TDENetworkConnectionStatus::Invalid, dev->deviceNode());
-		}
-	}
-}
-
 void WirelessDeviceTray::tdeAccessPointStatusChangedHandler(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) {
 	TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
 	TDENetworkConnectionManager* deviceConnMan = dev->connectionManager();
@@ -487,8 +468,20 @@ WirelessDeviceTray::WirelessDeviceTray (TQString dev, KSystemTray * parent, cons
 	setPixmapForState(TDENetworkConnectionStatus::Disconnected, "wireless");
 	setPixmapForState(TDENetworkConnectionStatus::Connected, "nm_signal_50");
 
-	// Trigger an initial hardware information update
-	tdeHardwareEventHandler(TDEHardwareEvent::HardwareListModified, TQString::null);
+	// initial hardware information update
+	TDENetworkDevice* netdev = dynamic_cast<TDENetworkDevice*>(hwdevices->findByUniqueID(d->dev));
+	TDENetworkConnectionManager* deviceConnMan = (netdev)?netdev->connectionManager():NULL;
+
+	// get notified when the device state changes
+	connect(deviceConnMan, TQT_SIGNAL(networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)), this, TQT_SLOT(slotUpdateDeviceState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)));
+
+	// get notified of all AP changes
+	connect(deviceConnMan, TQT_SIGNAL(accessPointStatusChanged(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)), this, TQT_SLOT(tdeAccessPointStatusChangedHandler(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType)));
+
+	// force status update to ensure correct icon is shown on startup
+	if ((netdev) && (deviceConnMan)) {
+		slotUpdateDeviceState(deviceConnMan->deviceInformation().statusFlags, TDENetworkConnectionStatus::Invalid, netdev->deviceNode());
+	}
 }
 
 WirelessDeviceTray::~WirelessDeviceTray ()
diff --git a/tdenetworkmanager/src/tdenetman-wireless_device_tray.h b/tdenetworkmanager/src/tdenetman-wireless_device_tray.h
index 59a24a1..eb429b9 100644
--- a/tdenetworkmanager/src/tdenetman-wireless_device_tray.h
+++ b/tdenetworkmanager/src/tdenetman-wireless_device_tray.h
@@ -66,7 +66,6 @@ class WirelessDeviceTray : public DeviceTrayComponent
 		void slotAccessPointRemoved(TDEMACAddress);
 
 	private slots:
-		void tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent, TQString);
 		void tdeAccessPointStatusChangedHandler(TDEMACAddress, TDENetworkAPEventType::TDENetworkAPEventType);
 		void sendUpdateUI();