|
|
@ -402,7 +402,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
|
|
|
|
m_deviceList.append(device);
|
|
|
|
m_deviceList.append(device);
|
|
|
|
updateParentDeviceInformation(device); // Update parent/child tables for this device
|
|
|
|
updateParentDeviceInformation(device); // Update parent/child tables for this device
|
|
|
|
emit hardwareAdded(device);
|
|
|
|
emit hardwareAdded(device);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareAdded, device->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (actionevent == "remove") {
|
|
|
|
else if (actionevent == "remove") {
|
|
|
@ -425,7 +424,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
|
|
|
|
if (slavedevice) {
|
|
|
|
if (slavedevice) {
|
|
|
|
rescanDeviceInformation(slavedevice);
|
|
|
|
rescanDeviceInformation(slavedevice);
|
|
|
|
emit hardwareUpdated(slavedevice);
|
|
|
|
emit hardwareUpdated(slavedevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -434,7 +432,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
emit hardwareRemoved(hwdevice);
|
|
|
|
emit hardwareRemoved(hwdevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareRemoved, hwdevice->uniqueID());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reenable auto-deletion and delete the removed device object
|
|
|
|
// Reenable auto-deletion and delete the removed device object
|
|
|
|
m_deviceList.setAutoDelete(true);
|
|
|
|
m_deviceList.setAutoDelete(true);
|
|
|
@ -455,7 +452,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
|
|
|
|
classifyUnknownDevice(dev, hwdevice, false);
|
|
|
|
classifyUnknownDevice(dev, hwdevice, false);
|
|
|
|
updateParentDeviceInformation(hwdevice); // Update parent/child tables for this device
|
|
|
|
updateParentDeviceInformation(hwdevice); // Update parent/child tables for this device
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((hwdevice->type() == TDEGenericDeviceType::Monitor)
|
|
|
|
else if ((hwdevice->type() == TDEGenericDeviceType::Monitor)
|
|
|
@ -467,7 +463,6 @@ void TDEHardwareDevices::processHotPluggedHardware() {
|
|
|
|
udev_device_unref(slavedev);
|
|
|
|
udev_device_unref(slavedev);
|
|
|
|
updateParentDeviceInformation(hwdevice); // Update parent/child tables for this device
|
|
|
|
updateParentDeviceInformation(hwdevice); // Update parent/child tables for this device
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -863,7 +858,6 @@ void TDEHardwareDevices::processModifiedCPUs() {
|
|
|
|
if (hwdevice) {
|
|
|
|
if (hwdevice) {
|
|
|
|
// Signal new information available
|
|
|
|
// Signal new information available
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
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)) {
|
|
|
|
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);
|
|
|
|
rescanDeviceInformation(hwdevice, false);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
|
|
|
|
|
|
|
|
#ifdef STATELESSPROFILING
|
|
|
|
#ifdef STATELESSPROFILING
|
|
|
|
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
|
|
|
|
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);
|
|
|
|
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) {
|
|
|
|
if (hwdevice->type() == TDEGenericDeviceType::Battery) {
|
|
|
|
rescanDeviceInformation(hwdevice, false);
|
|
|
|
rescanDeviceInformation(hwdevice, false);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hwdevice->type() == TDEGenericDeviceType::PowerSupply) {
|
|
|
|
else if (hwdevice->type() == TDEGenericDeviceType::PowerSupply) {
|
|
|
|
TDEMainsPowerDevice *pdevice = dynamic_cast<TDEMainsPowerDevice*>(hwdevice);
|
|
|
|
TDEMainsPowerDevice *pdevice = dynamic_cast<TDEMainsPowerDevice*>(hwdevice);
|
|
|
@ -926,7 +918,6 @@ void TDEHardwareDevices::processBatteryDevices() {
|
|
|
|
rescanDeviceInformation(hwdevice, false);
|
|
|
|
rescanDeviceInformation(hwdevice, false);
|
|
|
|
if (pdevice->online() != previousOnlineState) {
|
|
|
|
if (pdevice->online() != previousOnlineState) {
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareUpdated(hwdevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -973,7 +964,6 @@ void TDEHardwareDevices::processModifiedMounts() {
|
|
|
|
TDEGenericDevice* hwdevice = findByDeviceNode(*mountInfo.at(0));
|
|
|
|
TDEGenericDevice* hwdevice = findByDeviceNode(*mountInfo.at(0));
|
|
|
|
if (hwdevice) {
|
|
|
|
if (hwdevice) {
|
|
|
|
emit hardwareUpdated(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 the device is a storage device and has a slave, update it as well
|
|
|
|
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
|
|
|
|
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
|
|
|
|
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
|
|
|
|
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
|
|
|
@ -982,7 +972,6 @@ void TDEHardwareDevices::processModifiedMounts() {
|
|
|
|
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
|
|
|
|
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
|
|
|
|
if (slavedevice) {
|
|
|
|
if (slavedevice) {
|
|
|
|
emit hardwareUpdated(slavedevice);
|
|
|
|
emit hardwareUpdated(slavedevice);
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -994,7 +983,6 @@ void TDEHardwareDevices::processModifiedMounts() {
|
|
|
|
TDEGenericDevice* hwdevice = findByDeviceNode(*mountInfo.at(0));
|
|
|
|
TDEGenericDevice* hwdevice = findByDeviceNode(*mountInfo.at(0));
|
|
|
|
if (hwdevice) {
|
|
|
|
if (hwdevice) {
|
|
|
|
emit hardwareUpdated(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 the device is a storage device and has a slave, update it as well
|
|
|
|
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
|
|
|
|
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
|
|
|
|
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
|
|
|
|
TDEStorageDevice* sdevice = static_cast<TDEStorageDevice*>(hwdevice);
|
|
|
@ -1003,15 +991,11 @@ void TDEHardwareDevices::processModifiedMounts() {
|
|
|
|
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
|
|
|
|
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
|
|
|
|
if (slavedevice) {
|
|
|
|
if (slavedevice) {
|
|
|
|
emit hardwareUpdated(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) {
|
|
|
|
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
|
|
|
|
// Update parent/child tables for all devices
|
|
|
|
updateParentDeviceInformation();
|
|
|
|
updateParentDeviceInformation();
|
|
|
|
|
|
|
|
|
|
|
|
emit hardwareEvent(TDEHardwareEvent::HardwareListModified, TQString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|