Removed unused code related to hardware events.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/143/head
Michele Calgaro 3 years ago
parent 4b37b35141
commit 4a8875301d
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -402,7 +402,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
m_deviceList.append(device);
updateParentDeviceInformation(device); // Update parent/child tables for this device
emit hardwareAdded(device);
emit hardwareEvent(TDEHardwareEvent::HardwareAdded, device->uniqueID());
}
}
else if (actionevent == "remove") {
@ -425,7 +424,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
if (slavedevice) {
rescanDeviceInformation(slavedevice);
emit hardwareUpdated(slavedevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
}
}
}
@ -434,7 +432,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
}
emit hardwareRemoved(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareRemoved, hwdevice->uniqueID());
// Reenable auto-deletion and delete the removed device object
m_deviceList.setAutoDelete(true);
@ -455,7 +452,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
classifyUnknownDevice(dev, hwdevice, false);
updateParentDeviceInformation(hwdevice); // Update parent/child tables for this device
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
else if ((hwdevice->type() == TDEGenericDeviceType::Monitor)
@ -467,7 +463,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
udev_device_unref(slavedev);
updateParentDeviceInformation(hwdevice); // Update parent/child tables for this device
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
}
@ -863,7 +858,6 @@ void TDEHardwareDevices::processModifiedCPUs() {
if (hwdevice) {
// Signal new information available
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
}
@ -893,7 +887,6 @@ void TDEHardwareDevices::processStatelessDevices() {
if ((hwdevice->type() == TDEGenericDeviceType::RootSystem) || (hwdevice->type() == TDEGenericDeviceType::Network) || (hwdevice->type() == TDEGenericDeviceType::OtherSensor) || (hwdevice->type() == TDEGenericDeviceType::Event) || (hwdevice->type() == TDEGenericDeviceType::Battery) || (hwdevice->type() == TDEGenericDeviceType::PowerSupply)) {
rescanDeviceInformation(hwdevice, false);
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
#ifdef STATELESSPROFILING
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
printf("TDEHardwareDevices::processStatelessDevices() : '%s' finished at %u [%u]\n", (hwdevice->name()).ascii(), time2.tv_nsec, diff(time1,time2).tv_nsec);
@ -918,7 +911,6 @@ void TDEHardwareDevices::processBatteryDevices() {
if (hwdevice->type() == TDEGenericDeviceType::Battery) {
rescanDeviceInformation(hwdevice, false);
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
else if (hwdevice->type() == TDEGenericDeviceType::PowerSupply) {
TDEMainsPowerDevice *pdevice = dynamic_cast<TDEMainsPowerDevice*>(hwdevice);
@ -926,7 +918,6 @@ void TDEHardwareDevices::processBatteryDevices() {
rescanDeviceInformation(hwdevice, false);
if (pdevice->online() != previousOnlineState) {
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
}
@ -973,7 +964,6 @@ void TDEHardwareDevices::processModifiedMounts() {
TDEGenericDevice* hwdevice = findByDeviceNode(*mountInfo.at(0));
if (hwdevice) {
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
// If the device is a storage device and has a slave, update it as well
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
@ -982,7 +972,6 @@ void TDEHardwareDevices::processModifiedMounts() {
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
if (slavedevice) {
emit hardwareUpdated(slavedevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
}
}
}
@ -994,7 +983,6 @@ void TDEHardwareDevices::processModifiedMounts() {
TDEGenericDevice* hwdevice = findByDeviceNode(*mountInfo.at(0));
if (hwdevice) {
emit hardwareUpdated(hwdevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
// If the device is a storage device and has a slave, update it as well
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
@ -1003,15 +991,11 @@ void TDEHardwareDevices::processModifiedMounts() {
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
if (slavedevice) {
emit hardwareUpdated(slavedevice);
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
}
}
}
}
}
emit mountTableModified();
emit hardwareEvent(TDEHardwareEvent::MountTableModified, TQString());
}
TDEDiskDeviceType::TDEDiskDeviceType classifyDiskType(udev_device* dev, const TQString devicenode, const TQString devicebus, const TQString disktypestring, const TQString systempath, const TQString devicevendor, const TQString devicemodel, const TQString filesystemtype, const TQString devicedriver) {
@ -3689,8 +3673,6 @@ bool TDEHardwareDevices::queryHardwareInformation() {
// Update parent/child tables for all devices
updateParentDeviceInformation();
emit hardwareEvent(TDEHardwareEvent::HardwareListModified, TQString());
return true;
}

@ -250,8 +250,6 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject
void hardwareAdded(TDEGenericDevice*);
void hardwareRemoved(TDEGenericDevice*);
void hardwareUpdated(TDEGenericDevice*);
void mountTableModified();
void hardwareEvent(TDEHardwareEvent::TDEHardwareEvent, TQString uuid);
/**
* @param keycode the code of the key that was pressed/released

@ -91,16 +91,4 @@ enum TDEDisplayPowerLevel {
};
};
namespace TDEHardwareEvent {
enum TDEHardwareEvent {
HardwareListModified,
MountTableModified,
HardwareAdded,
HardwareRemoved,
HardwareUpdated,
Other,
Last = Other
};
};
#endif // _TDEHWCOMMON_H

Loading…
Cancel
Save