By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 2748
Collapse All | Expand All

(-)a/tdecore/tdehw/networkbackends/network-manager/network-manager.cpp (-137 / +20 lines)
Lines 1137-1143 TQString tdeIBTransportToNMIBTransport(TDENetworkInfinibandTransportMode::TDENet Link Here
1137
	return ret;
1137
	return ret;
1138
}
1138
}
1139
1139
1140
TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString macAddress) {
1140
TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString deviceNode) {
1141
	if (d->m_networkManagerProxy) {
1141
	if (d->m_networkManagerProxy) {
1142
		TQT_DBusObjectPathList devices;
1142
		TQT_DBusObjectPathList devices;
1143
		TQT_DBusError error;
1143
		TQT_DBusError error;
Lines 1148-1221 TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString m Link Here
1148
			for (it = devices.begin(); it != devices.end(); ++it) {
1148
			for (it = devices.begin(); it != devices.end(); ++it) {
1149
				DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, (*it));
1149
				DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, (*it));
1150
				genericDevice.setConnection(TQT_DBusConnection::systemBus());
1150
				genericDevice.setConnection(TQT_DBusConnection::systemBus());
1151
				TDENetworkDeviceType::TDENetworkDeviceType deviceType = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error));
1151
				TQString deviceInterface = genericDevice.getInterface(error);
1152
				if (error.isValid()) {
1152
				if (error.isValid()) {
1153
					// Error!
1153
					// Error!
1154
					PRINT_ERROR((error.name() + ": " + error.message()))
1154
					PRINT_ERROR((error.name() + ": " + error.message()))
1155
					break;
1155
					break;
1156
				}
1156
				}
1157
				else if (deviceType == TDENetworkDeviceType::WiredEthernet) {
1157
				else if (deviceInterface == deviceNode) {
1158
					DBus::EthernetDeviceProxy ethernetDevice(NM_DBUS_SERVICE, (*it));
1158
					return (*it);
1159
					ethernetDevice.setConnection(TQT_DBusConnection::systemBus());
1160
					TQString candidateMACAddress = ethernetDevice.getPermHwAddress(error);
1161
					if (!error.isValid()) {
1162
						if (candidateMACAddress.lower() == macAddress.lower()) {
1163
							return (*it);
1164
						}
1165
					}
1166
				}
1167
				else if (deviceType == TDENetworkDeviceType::Infiniband) {
1168
					DBus::InfinibandDeviceProxy infinibandDevice(NM_DBUS_SERVICE, (*it));
1169
					infinibandDevice.setConnection(TQT_DBusConnection::systemBus());
1170
					TQString candidateMACAddress = infinibandDevice.getHwAddress(error);
1171
					if (!error.isValid()) {
1172
						if (candidateMACAddress.lower() == macAddress.lower()) {
1173
							return (*it);
1174
						}
1175
					}
1176
				}
1177
				else if (deviceType == TDENetworkDeviceType::WiFi) {
1178
					DBus::WiFiDeviceProxy wiFiDevice(NM_DBUS_SERVICE, (*it));
1179
					wiFiDevice.setConnection(TQT_DBusConnection::systemBus());
1180
					TQString candidateMACAddress = wiFiDevice.getPermHwAddress(error);
1181
					if (!error.isValid()) {
1182
						if (candidateMACAddress.lower() == macAddress.lower()) {
1183
							return (*it);
1184
						}
1185
					}
1186
				}
1187
				else if (deviceType == TDENetworkDeviceType::WiMax) {
1188
					DBus::WiMaxDeviceProxy wiMaxDevice(NM_DBUS_SERVICE, (*it));
1189
					wiMaxDevice.setConnection(TQT_DBusConnection::systemBus());
1190
					TQString candidateMACAddress = wiMaxDevice.getHwAddress(error);
1191
					if (!error.isValid()) {
1192
						if (candidateMACAddress.lower() == macAddress.lower()) {
1193
							return (*it);
1194
						}
1195
					}
1196
				}
1159
				}
1197
				else if (deviceType == TDENetworkDeviceType::OLPCMesh) {
1198
					DBus::OlpcMeshDeviceProxy olpcMeshDevice(NM_DBUS_SERVICE, (*it));
1199
					olpcMeshDevice.setConnection(TQT_DBusConnection::systemBus());
1200
					TQString candidateMACAddress = olpcMeshDevice.getHwAddress(error);
1201
					if (!error.isValid()) {
1202
						if (candidateMACAddress.lower() == macAddress.lower()) {
1203
							return (*it);
1204
						}
1205
					}
1206
				}
1207
				else if (deviceType == TDENetworkDeviceType::Bluetooth) {
1208
					DBus::BluetoothDeviceProxy bluetoothDevice(NM_DBUS_SERVICE, (*it));
1209
					bluetoothDevice.setConnection(TQT_DBusConnection::systemBus());
1210
					TQString candidateMACAddress = bluetoothDevice.getHwAddress(error);
1211
					if (!error.isValid()) {
1212
						if (candidateMACAddress.lower() == macAddress.lower()) {
1213
							return (*it);
1214
						}
1215
					}
1216
				}
1217
				// FIXME
1218
				// Add other supported device types here
1219
			}
1160
			}
1220
			return "";
1161
			return "";
1221
		}
1162
		}
Lines 1230-1301 TQString TDENetworkConnectionManager_BackendNM::deviceInterfaceString(TQString m Link Here
1230
	}
1171
	}
1231
}
1172
}
1232
1173
1233
TQString macAddressForGenericDevice(TQT_DBusObjectPath path) {
1174
TQString tdeDeviceUUIDForGenericDevice(TQT_DBusObjectPath path) {
1234
	TQT_DBusError error;
1175
	TQT_DBusError error;
1235
1236
	DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, path);
1176
	DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, path);
1237
	genericDevice.setConnection(TQT_DBusConnection::systemBus());
1177
	genericDevice.setConnection(TQT_DBusConnection::systemBus());
1238
	TQ_UINT32 deviceType = genericDevice.getDeviceType(error);
1178
	TQString deviceInterface = genericDevice.getInterface(error);
1239
	if (error.isValid()) {
1179
	if (error.isValid()) {
1240
		// Error!
1180
		return TQString::null;
1241
		PRINT_ERROR((error.name() + ": " + error.message()))
1242
		return TQString();
1243
	}
1244
	else if (deviceType == NM_DEVICE_TYPE_ETHERNET) {
1245
		DBus::EthernetDeviceProxy ethernetDevice(NM_DBUS_SERVICE, path);
1246
		ethernetDevice.setConnection(TQT_DBusConnection::systemBus());
1247
		TQString candidateMACAddress = ethernetDevice.getPermHwAddress(error);
1248
		if (!error.isValid()) {
1249
			return candidateMACAddress.lower();
1250
		}
1251
	}
1252
	else if (deviceType == NM_DEVICE_TYPE_INFINIBAND) {
1253
		DBus::InfinibandDeviceProxy infinibandDevice(NM_DBUS_SERVICE, path);
1254
		infinibandDevice.setConnection(TQT_DBusConnection::systemBus());
1255
		TQString candidateMACAddress = infinibandDevice.getHwAddress(error);
1256
		if (!error.isValid()) {
1257
			return candidateMACAddress.lower();
1258
		}
1259
	}
1260
	else if (deviceType == NM_DEVICE_TYPE_WIFI) {
1261
		DBus::WiFiDeviceProxy wiFiDevice(NM_DBUS_SERVICE, path);
1262
		wiFiDevice.setConnection(TQT_DBusConnection::systemBus());
1263
		TQString candidateMACAddress = wiFiDevice.getPermHwAddress(error);
1264
		if (!error.isValid()) {
1265
			return candidateMACAddress.lower();
1266
		}
1267
	}
1268
	else if (deviceType == NM_DEVICE_TYPE_WIMAX) {
1269
		DBus::WiMaxDeviceProxy wiMaxDevice(NM_DBUS_SERVICE, path);
1270
		wiMaxDevice.setConnection(TQT_DBusConnection::systemBus());
1271
		TQString candidateMACAddress = wiMaxDevice.getHwAddress(error);
1272
		if (!error.isValid()) {
1273
			return candidateMACAddress.lower();
1274
		}
1275
	}
1276
	else if (deviceType == NM_DEVICE_TYPE_OLPC_MESH) {
1277
		DBus::OlpcMeshDeviceProxy olpcMeshDevice(NM_DBUS_SERVICE, path);
1278
		olpcMeshDevice.setConnection(TQT_DBusConnection::systemBus());
1279
		TQString candidateMACAddress = olpcMeshDevice.getHwAddress(error);
1280
		if (!error.isValid()) {
1281
			return candidateMACAddress.lower();
1282
		}
1283
	}
1284
	else if (deviceType == NM_DEVICE_TYPE_BT) {
1285
		DBus::BluetoothDeviceProxy bluetoothDevice(NM_DBUS_SERVICE, path);
1286
		bluetoothDevice.setConnection(TQT_DBusConnection::systemBus());
1287
		TQString candidateMACAddress = bluetoothDevice.getHwAddress(error);
1288
		if (!error.isValid()) {
1289
			return candidateMACAddress.lower();
1290
		}
1291
	}
1181
	}
1292
	// FIXME
1293
	// Add other supported device types here
1294
1295
	return TQString::null;
1296
}
1297
1182
1298
TQString tdeDeviceUUIDForMACAddress(TQString macAddress) {
1299
	TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
1183
	TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
1300
	if (!hwdevices) {
1184
	if (!hwdevices) {
1301
		return TQString::null;
1185
		return TQString::null;
Lines 1305-1311 TQString tdeDeviceUUIDForMACAddress(TQString macAddress) { Link Here
1305
	for (TDEGenericHardwareList::iterator it = devices.begin(); it != devices.end(); ++it) {
1189
	for (TDEGenericHardwareList::iterator it = devices.begin(); it != devices.end(); ++it) {
1306
		TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(*it);
1190
		TDENetworkDevice* dev = dynamic_cast<TDENetworkDevice*>(*it);
1307
		if (dev) {
1191
		if (dev) {
1308
			if (macAddress.lower() == dev->macAddress().lower()) {
1192
			if (deviceInterface == dev->deviceNode()) {
1309
				return dev->uniqueID();
1193
				return dev->uniqueID();
1310
			}
1194
			}
1311
		}
1195
		}
Lines 1355-1361 void TDENetworkConnectionManager_BackendNM_DBusSignalReceiver::dbusSignal(const Link Here
1355
	}
1239
	}
1356
}
1240
}
1357
1241
1358
TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQString macAddress) : TDENetworkConnectionManager(macAddress) {
1242
TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice) : TDENetworkConnectionManager(networkDevice) {
1359
	d = new TDENetworkConnectionManager_BackendNMPrivate(this);
1243
	d = new TDENetworkConnectionManager_BackendNMPrivate(this);
1360
1244
1361
	// Set up proxy interfaces
1245
	// Set up proxy interfaces
Lines 1366-1372 TDENetworkConnectionManager_BackendNM::TDENetworkConnectionManager_BackendNM(TQS Link Here
1366
	d->m_vpnProxy = new DBus::VPNPluginProxy(NM_VPN_DBUS_PLUGIN_SERVICE, NM_VPN_DBUS_PLUGIN_PATH);
1250
	d->m_vpnProxy = new DBus::VPNPluginProxy(NM_VPN_DBUS_PLUGIN_SERVICE, NM_VPN_DBUS_PLUGIN_PATH);
1367
	d->m_vpnProxy->setConnection(TQT_DBusConnection::systemBus());
1251
	d->m_vpnProxy->setConnection(TQT_DBusConnection::systemBus());
1368
1252
1369
	d->m_dbusDeviceString = deviceInterfaceString(macAddress);
1253
	d->m_dbusDeviceString = deviceInterfaceString(deviceNode());
1370
	if (d->m_dbusDeviceString != "") {
1254
	if (d->m_dbusDeviceString != "") {
1371
		d->m_networkDeviceProxy = new DBus::DeviceProxy(NM_DBUS_SERVICE, d->m_dbusDeviceString);
1255
		d->m_networkDeviceProxy = new DBus::DeviceProxy(NM_DBUS_SERVICE, d->m_dbusDeviceString);
1372
		d->m_networkDeviceProxy->setConnection(TQT_DBusConnection::systemBus());
1256
		d->m_networkDeviceProxy->setConnection(TQT_DBusConnection::systemBus());
Lines 1618-1624 void TDENetworkConnectionManager_BackendNMPrivate::internalProcessDeviceStateCha Link Here
1618
		m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, errorString);
1502
		m_parent->internalNetworkDeviceEvent(TDENetworkDeviceEventType::Failure, errorString);
1619
	}
1503
	}
1620
1504
1621
	m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->m_macAddress);
1505
	m_parent->internalNetworkDeviceStateChanged(nmDeviceStateToTDEDeviceState(newState), m_parent->deviceNode());
1622
}
1506
}
1623
1507
1624
void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath& dbuspath) {
1508
void TDENetworkConnectionManager_BackendNMPrivate::internalProcessWiFiAccessPointAdded(const TQT_DBusObjectPath& dbuspath) {
Lines 1682-1695 void TDENetworkConnectionManager_BackendNMPrivate::internalProcessAPPropertiesCh Link Here
1682
}
1566
}
1683
1567
1684
TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM::deviceType() {
1568
TDENetworkDeviceType::TDENetworkDeviceType TDENetworkConnectionManager_BackendNM::deviceType() {
1685
	if (m_macAddress == "") {
1569
	if (m_networkDevice == NULL) {
1686
		return TDENetworkDeviceType::BackendOnly;
1570
		return TDENetworkDeviceType::BackendOnly;
1687
	}
1571
	}
1688
	else {
1572
	else {
1689
		if (d->m_dbusDeviceString != "") {
1573
		if (d->m_dbusDeviceString != "") {
1690
			// Query NM for the device type
1574
			// Query NM for the device type
1691
			TQT_DBusError error;
1575
			TQT_DBusError error;
1692
			d->m_dbusDeviceString = deviceInterfaceString(m_macAddress);
1576
			d->m_dbusDeviceString = deviceInterfaceString(deviceNode());
1693
			DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, d->m_dbusDeviceString);
1577
			DBus::DeviceProxy genericDevice(NM_DBUS_SERVICE, d->m_dbusDeviceString);
1694
			genericDevice.setConnection(TQT_DBusConnection::systemBus());
1578
			genericDevice.setConnection(TQT_DBusConnection::systemBus());
1695
			TDENetworkDeviceType::TDENetworkDeviceType ret = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error));
1579
			TDENetworkDeviceType::TDENetworkDeviceType ret = nmDeviceTypeToTDEDeviceType(genericDevice.getDeviceType(error));
Lines 1981-1987 void TDENetworkConnectionManager_BackendNM::loadConnectionInformation() { Link Here
1981
	d->nonReentrantCallActive = true;
1865
	d->nonReentrantCallActive = true;
1982
1866
1983
	TDEMACAddress deviceMACAddress;
1867
	TDEMACAddress deviceMACAddress;
1984
	deviceMACAddress.fromString(m_macAddress);
1868
	deviceMACAddress.fromString(this->deviceMACAddress());
1985
1869
1986
	if (d->m_networkManagerSettings) {
1870
	if (d->m_networkManagerSettings) {
1987
		clearTDENetworkConnectionList();
1871
		clearTDENetworkConnectionList();
Lines 4953-4963 TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag Link Here
4953
	if ((d->m_networkManagerSettings) && (d->m_networkManagerProxy)) {
4837
	if ((d->m_networkManagerSettings) && (d->m_networkManagerProxy)) {
4954
		ret = d->m_networkManagerSettings->GetConnectionByUuid(uuid, existingConnection, error);
4838
		ret = d->m_networkManagerSettings->GetConnectionByUuid(uuid, existingConnection, error);
4955
		if (ret) {
4839
		if (ret) {
4956
			if (m_macAddress == "") {
4840
			if (m_networkDevice == NULL) {
4957
				d->m_dbusDeviceString = "/";
4841
				d->m_dbusDeviceString = "/";
4958
			}
4842
			}
4959
			else {
4843
			else {
4960
				d->m_dbusDeviceString = deviceInterfaceString(m_macAddress);
4844
				d->m_dbusDeviceString = deviceInterfaceString(deviceNode());
4961
			}
4845
			}
4962
#ifndef USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS
4846
#ifndef USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS
4963
			TQT_DBusObjectPath active_connection;
4847
			TQT_DBusObjectPath active_connection;
Lines 5087-5094 TQStringList TDENetworkConnectionManager_BackendNM::connectionPhysicalDeviceUUID Link Here
5087
				TQValueList<TQT_DBusObjectPath> deviceList = activeConnection.getDevices(error);
4971
				TQValueList<TQT_DBusObjectPath> deviceList = activeConnection.getDevices(error);
5088
				TQT_DBusObjectPathList::iterator it2;
4972
				TQT_DBusObjectPathList::iterator it2;
5089
				for (it2 = deviceList.begin(); it2 != deviceList.end(); ++it2) {
4973
				for (it2 = deviceList.begin(); it2 != deviceList.end(); ++it2) {
5090
					TQString macAddress = macAddressForGenericDevice(*it2);
4974
					TQString devUUID = tdeDeviceUUIDForGenericDevice(*it2);
5091
					TQString devUUID = tdeDeviceUUIDForMACAddress(macAddress);
5092
					if (devUUID != "") {
4975
					if (devUUID != "") {
5093
						ret.append(devUUID);
4976
						ret.append(devUUID);
5094
					}
4977
					}
Lines 5147-5157 TDENetworkConnectionStatus::TDENetworkConnectionStatus TDENetworkConnectionManag Link Here
5147
	if ((d->m_networkManagerSettings) && (d->m_networkManagerProxy)) {
5030
	if ((d->m_networkManagerSettings) && (d->m_networkManagerProxy)) {
5148
		existingConnection = getActiveConnectionPath(uuid);
5031
		existingConnection = getActiveConnectionPath(uuid);
5149
		if (existingConnection.isValid()) {
5032
		if (existingConnection.isValid()) {
5150
			if (m_macAddress == "") {
5033
			if (m_networkDevice == NULL) {
5151
				d->m_dbusDeviceString = "/";
5034
				d->m_dbusDeviceString = "/";
5152
			}
5035
			}
5153
			else {
5036
			else {
5154
				d->m_dbusDeviceString = deviceInterfaceString(m_macAddress);
5037
				d->m_dbusDeviceString = deviceInterfaceString(deviceNode());
5155
			}
5038
			}
5156
#ifndef USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS
5039
#ifndef USE_ASYNC_DBUS_CONNECTION_COMMAND_CALLS
5157
			ret = d->m_networkManagerProxy->DeactivateConnection(existingConnection, error);
5040
			ret = d->m_networkManagerProxy->DeactivateConnection(existingConnection, error);
Lines 5435-5441 TDENetworkHWNeighborList* TDENetworkConnectionManager_BackendNM::siteSurvey() { Link Here
5435
	bool ret;
5318
	bool ret;
5436
5319
5437
	TDENetworkDeviceType::TDENetworkDeviceType myDeviceType = deviceType();
5320
	TDENetworkDeviceType::TDENetworkDeviceType myDeviceType = deviceType();
5438
	d->m_dbusDeviceString = deviceInterfaceString(m_macAddress);
5321
	d->m_dbusDeviceString = deviceInterfaceString(deviceNode());
5439
	clearTDENetworkHWNeighborList();
5322
	clearTDENetworkHWNeighborList();
5440
5323
5441
	if (myDeviceType == TDENetworkDeviceType::WiFi) {
5324
	if (myDeviceType == TDENetworkDeviceType::WiFi) {
(-)a/tdecore/tdehw/networkbackends/network-manager/network-manager.h (-2 / +2 lines)
Lines 213-219 class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo Link Here
213
	Q_OBJECT
213
	Q_OBJECT
214
214
215
	public:
215
	public:
216
		TDENetworkConnectionManager_BackendNM(TQString macAddress);
216
		TDENetworkConnectionManager_BackendNM(TDENetworkDevice* networkDevice);
217
		~TDENetworkConnectionManager_BackendNM();
217
		~TDENetworkConnectionManager_BackendNM();
218
218
219
		virtual TQString backendName();
219
		virtual TQString backendName();
Lines 249-255 class TDECORE_EXPORT TDENetworkConnectionManager_BackendNM : public TDENetworkCo Link Here
249
249
250
	private:
250
	private:
251
		TDENetworkDeviceType::TDENetworkDeviceType nmDeviceTypeToTDEDeviceType(TQ_UINT32 nmType);
251
		TDENetworkDeviceType::TDENetworkDeviceType nmDeviceTypeToTDEDeviceType(TQ_UINT32 nmType);
252
		TQString deviceInterfaceString(TQString macAddress);
252
		TQString deviceInterfaceString(TQString deviceNode);
253
		bool loadConnectionSecretsForGroup(TQString uuid, TQString group);
253
		bool loadConnectionSecretsForGroup(TQString uuid, TQString group);
254
		TDENetworkWiFiAPInfo* getAccessPointDetails(TQString dbusPath);
254
		TDENetworkWiFiAPInfo* getAccessPointDetails(TQString dbusPath);
255
		TDENetworkConnectionType::TDENetworkConnectionType connectionType(TQString dbusPath);
255
		TDENetworkConnectionType::TDENetworkConnectionType connectionType(TQString dbusPath);
(-)a/tdecore/tdehw/tdenetworkconnections.cpp (-10 / +14 lines)
Lines 698-704 TDEWiFiConnection::~TDEWiFiConnection() { Link Here
698
/* TDENetworkConnectionManager                                                                    */
698
/* TDENetworkConnectionManager                                                                    */
699
/*================================================================================================*/
699
/*================================================================================================*/
700
700
701
TDENetworkConnectionManager::TDENetworkConnectionManager(TQString macAddress) : TQObject(), m_connectionList(NULL), m_hwNeighborList(NULL), m_macAddress(macAddress), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
701
TDENetworkConnectionManager::TDENetworkConnectionManager(TDENetworkDevice *networkDevice) : TQObject(), m_connectionList(NULL), m_hwNeighborList(NULL), m_networkDevice(networkDevice), m_prevConnectionStatus(TDENetworkGlobalManagerFlags::Unknown) {
702
	m_emissionTimer = new TQTimer();
702
	m_emissionTimer = new TQTimer();
703
	connect(m_emissionTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(emitQueuedSignals()));
703
	connect(m_emissionTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(emitQueuedSignals()));
704
	if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, TRUE);
704
	if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, TRUE);
Lines 709-716 TDENetworkConnectionManager::~TDENetworkConnectionManager() { Link Here
709
	delete m_emissionTimer;
709
	delete m_emissionTimer;
710
}
710
}
711
711
712
TQString TDENetworkConnectionManager::deviceNode() {
713
	return m_networkDevice ? m_networkDevice->deviceNode() : TQString();
714
}
715
712
TQString TDENetworkConnectionManager::deviceMACAddress() {
716
TQString TDENetworkConnectionManager::deviceMACAddress() {
713
	return m_macAddress;
717
	return m_networkDevice ? m_networkDevice->macAddress() : TQString();
714
}
718
}
715
719
716
TDENetworkConnectionList* TDENetworkConnectionManager::connections() {
720
TDENetworkConnectionList* TDENetworkConnectionManager::connections() {
Lines 856-875 void TDENetworkConnectionManager::internalNetworkConnectionStateChanged(TDENetwo Link Here
856
	m_prevConnectionStatus = newState;
860
	m_prevConnectionStatus = newState;
857
}
861
}
858
862
859
void TDENetworkConnectionManager::internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress) {
863
void TDENetworkConnectionManager::internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString deviceNodeName) {
860
	if (!m_prevDeviceStatus.contains(hwAddress)) {
864
	if (!m_prevDeviceStatus.contains(deviceNodeName)) {
861
		m_prevDeviceStatus[hwAddress] = TDENetworkConnectionStatus::Invalid;
865
		m_prevDeviceStatus[deviceNodeName] = TDENetworkConnectionStatus::Invalid;
862
	}
866
	}
863
867
864
	TDENetworkEventQueueEvent_Private queuedEvent;
868
	TDENetworkEventQueueEvent_Private queuedEvent;
865
	queuedEvent.eventType = 1;
869
	queuedEvent.eventType = 1;
866
	queuedEvent.newConnStatus = newState;
870
	queuedEvent.newConnStatus = newState;
867
	queuedEvent.previousConnStatus = m_prevDeviceStatus[hwAddress];
871
	queuedEvent.previousConnStatus = m_prevDeviceStatus[deviceNodeName];
868
	queuedEvent.hwAddress = hwAddress;
872
	queuedEvent.deviceNode = deviceNodeName;
869
	m_globalEventQueueEventList.append(queuedEvent);
873
	m_globalEventQueueEventList.append(queuedEvent);
870
	if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, TRUE);
874
	if (!m_emissionTimer->isActive()) m_emissionTimer->start(0, TRUE);
871
875
872
	m_prevDeviceStatus[hwAddress] = newState;
876
	m_prevDeviceStatus[deviceNodeName] = newState;
873
}
877
}
874
878
875
void TDENetworkConnectionManager::internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) {
879
void TDENetworkConnectionManager::internalAccessPointStatusChanged(TDEMACAddress BSSID, TDENetworkAPEventType::TDENetworkAPEventType event) {
Lines 921-927 void TDENetworkConnectionManager::emitQueuedSignals() { Link Here
921
				emit(networkConnectionStateChanged(event.newState, event.previousState));
925
				emit(networkConnectionStateChanged(event.newState, event.previousState));
922
			}
926
			}
923
			else if (event.eventType == 1) {
927
			else if (event.eventType == 1) {
924
				emit(networkDeviceStateChanged(event.newConnStatus, event.previousConnStatus, event.hwAddress));
928
				emit(networkDeviceStateChanged(event.newConnStatus, event.previousConnStatus, event.deviceNode));
925
			}
929
			}
926
			else if (event.eventType == 2) {
930
			else if (event.eventType == 2) {
927
				emit(accessPointStatusChanged(event.BSSID, event.apevent));
931
				emit(accessPointStatusChanged(event.BSSID, event.apevent));
Lines 948-954 void TDENetworkConnectionManager::emitQueuedSignals() { Link Here
948
952
949
TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager(NULL) {
953
TDEGlobalNetworkManager::TDEGlobalNetworkManager() : m_internalConnectionManager(NULL) {
950
#ifdef WITH_NETWORK_MANAGER_BACKEND
954
#ifdef WITH_NETWORK_MANAGER_BACKEND
951
	m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(TQString::null);
955
	m_internalConnectionManager = new TDENetworkConnectionManager_BackendNM(NULL);
952
#endif // WITH_NETWORK_MANAGER_BACKEND
956
#endif // WITH_NETWORK_MANAGER_BACKEND
953
	if (m_internalConnectionManager) {
957
	if (m_internalConnectionManager) {
954
		connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
958
		connect(m_internalConnectionManager, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)), this, SIGNAL(networkConnectionStateChanged(TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags, TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags)));
(-)a/tdecore/tdehw/tdenetworkconnections.h (-9 / +14 lines)
Lines 1003-1009 class TDENetworkEventQueueEvent_Private Link Here
1003
		TDENetworkConnectionStatus::TDENetworkConnectionStatus previousConnStatus;
1003
		TDENetworkConnectionStatus::TDENetworkConnectionStatus previousConnStatus;
1004
		TDEMACAddress BSSID;
1004
		TDEMACAddress BSSID;
1005
		TQString message;
1005
		TQString message;
1006
		TQString hwAddress;
1006
		TQString deviceNode;
1007
		TDENetworkAPEventType::TDENetworkAPEventType apevent;
1007
		TDENetworkAPEventType::TDENetworkAPEventType apevent;
1008
		TDENetworkDeviceEventType::TDENetworkDeviceEventType ndevent;
1008
		TDENetworkDeviceEventType::TDENetworkDeviceEventType ndevent;
1009
		TDENetworkVPNEventType::TDENetworkVPNEventType vpnevent;
1009
		TDENetworkVPNEventType::TDENetworkVPNEventType vpnevent;
Lines 1020-1031 class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject Link Here
1020
	public:
1020
	public:
1021
		/**
1021
		/**
1022
		*  Constructor.
1022
		*  Constructor.
1023
		*  @param macAddress The MAC address of the hardware device
1023
		*  @param networkDevice Pointer to holder network device
1024
		*  If an empty MAC address is passed, this object will make global networking backend
1024
		*  If the network device is passed null, this object will make global networking backend
1025
		*  methods available exclusively (TDENetworkDeviceType::BackendOnly).
1025
		*  methods available exclusively (TDENetworkDeviceType::BackendOnly).
1026
		*/
1026
		*/
1027
		TDENetworkConnectionManager(TQString macAddress);
1027
		TDENetworkConnectionManager(TDENetworkDevice *networkDevice);
1028
		
1028
1029
		/**
1029
		/**
1030
		* Destructor.
1030
		* Destructor.
1031
		*/
1031
		*/
Lines 1209-1215 class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject Link Here
1209
		* If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address
1209
		* If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address
1210
		* of the networking hardware that has changed state.
1210
		* of the networking hardware that has changed state.
1211
		*/
1211
		*/
1212
		void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress);
1212
		void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString deviceNode);
1213
1213
1214
		/**
1214
		/**
1215
		* Emitted whenever the status of a wireless access point changes
1215
		* Emitted whenever the status of a wireless access point changes
Lines 1254-1259 class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject Link Here
1254
		virtual TDENetworkConnectionList* connections();
1254
		virtual TDENetworkConnectionList* connections();
1255
1255
1256
		/**
1256
		/**
1257
		* @return the interface name of this device
1258
		*/
1259
		TQString deviceNode();
1260
1261
		/**
1257
		* @return the MAC address of this device
1262
		* @return the MAC address of this device
1258
		*/
1263
		*/
1259
		TQString deviceMACAddress();
1264
		TQString deviceMACAddress();
Lines 1318-1324 class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject Link Here
1318
		* @internal This method must be called by the network backend whenever a device changes state
1323
		* @internal This method must be called by the network backend whenever a device changes state
1319
		* It emits the appropriate signals to notify client applications of the state change
1324
		* It emits the appropriate signals to notify client applications of the state change
1320
		*/
1325
		*/
1321
		void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString hwAddress=TQString::null);
1326
		void internalNetworkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TQString deviceNode=TQString::null);
1322
1327
1323
		/**
1328
		/**
1324
		* @internal This method must be called by the network backend whenever a wireless access point changes state
1329
		* @internal This method must be called by the network backend whenever a wireless access point changes state
Lines 1350-1356 class TDECORE_EXPORT TDENetworkConnectionManager : public TQObject Link Here
1350
	protected:
1355
	protected:
1351
		TDENetworkConnectionList* m_connectionList;
1356
		TDENetworkConnectionList* m_connectionList;
1352
		TDENetworkHWNeighborList* m_hwNeighborList;
1357
		TDENetworkHWNeighborList* m_hwNeighborList;
1353
		TQString m_macAddress;
1358
		TDENetworkDevice* m_networkDevice;
1354
		TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags m_prevConnectionStatus;
1359
		TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags m_prevConnectionStatus;
1355
		TQMap<TQString, TDENetworkConnectionStatus::TDENetworkConnectionStatus> m_prevDeviceStatus;
1360
		TQMap<TQString, TDENetworkConnectionStatus::TDENetworkConnectionStatus> m_prevDeviceStatus;
1356
		TQTimer* m_emissionTimer;
1361
		TQTimer* m_emissionTimer;
Lines 1528-1534 class TDECORE_EXPORT TDEGlobalNetworkManager : public TQObject Link Here
1528
		* If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address
1533
		* If the global connection state has changed, @param hwAddress will be empty, otherwise it will contain the MAC address
1529
		* of the networking hardware that has changed state.
1534
		* of the networking hardware that has changed state.
1530
		*/
1535
		*/
1531
		void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress);
1536
		void networkDeviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString deviceNode);
1532
1537
1533
		/**
1538
		/**
1534
		* Emitted whenever the status of a wireless access point changes
1539
		* Emitted whenever the status of a wireless access point changes
(-)a/tdecore/tdehw/tdenetworkdevice.cpp (-1 / +1 lines)
Lines 174-180 void TDENetworkDevice::internalSetTxPackets(double tx) { Link Here
174
TDENetworkConnectionManager* TDENetworkDevice::connectionManager() {
174
TDENetworkConnectionManager* TDENetworkDevice::connectionManager() {
175
#ifdef WITH_NETWORK_MANAGER_BACKEND
175
#ifdef WITH_NETWORK_MANAGER_BACKEND
176
	if (!m_connectionManager) {
176
	if (!m_connectionManager) {
177
		m_connectionManager = new TDENetworkConnectionManager_BackendNM(m_macAddress);
177
		m_connectionManager = new TDENetworkConnectionManager_BackendNM(this);
178
	}
178
	}
179
#endif // WITH_NETWORK_MANAGER_BACKEND
179
#endif // WITH_NETWORK_MANAGER_BACKEND
180
180

Return to bug 2748