summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehardwaredevices.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-07 20:26:57 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-07 20:26:57 -0500
commit671940a29d4d57021a1bf63d310bbd854e07f1fa (patch)
treed93acfee6c46f08c32679f9f3914c9a56794b43b /tdecore/tdehardwaredevices.cpp
parent6b96deb4ebac9e55ff35d7f77313c5aebb103880 (diff)
downloadtdelibs-671940a29d4d57021a1bf63d310bbd854e07f1fa.tar.gz
tdelibs-671940a29d4d57021a1bf63d310bbd854e07f1fa.zip
Add new signal to tdehwlibrary
Diffstat (limited to 'tdecore/tdehardwaredevices.cpp')
-rw-r--r--tdecore/tdehardwaredevices.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp
index 77b847752..7e8b462eb 100644
--- a/tdecore/tdehardwaredevices.cpp
+++ b/tdecore/tdehardwaredevices.cpp
@@ -1354,6 +1354,9 @@ TDENetworkDevice::TDENetworkDevice(TDEGenericDeviceType::TDEGenericDeviceType dt
}
TDENetworkDevice::~TDENetworkDevice() {
+ if (m_connectionManager) {
+ delete m_connectionManager;
+ }
}
TQString TDENetworkDevice::macAddress() {
@@ -1939,6 +1942,7 @@ 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") {
@@ -1949,6 +1953,7 @@ void TDEHardwareDevices::processHotPluggedHardware() {
for (hwdevice = m_deviceList.first(); hwdevice; hwdevice = m_deviceList.next()) {
if (hwdevice->systemPath() == systempath) {
emit hardwareRemoved(hwdevice);
+ emit hardwareEvent(TDEHardwareEvent::HardwareRemoved, hwdevice->uniqueID());
// If the device is a storage device and has a slave, update it as well
if (hwdevice->type() == TDEGenericDeviceType::Disk) {
@@ -1960,6 +1965,7 @@ void TDEHardwareDevices::processHotPluggedHardware() {
if (slavedevice) {
rescanDeviceInformation(slavedevice);
emit hardwareUpdated(slavedevice);
+ emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
}
}
}
@@ -1982,6 +1988,7 @@ 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());
}
break;
}
@@ -2149,6 +2156,7 @@ void TDEHardwareDevices::processModifiedCPUs() {
TDEGenericDevice* hwdevice = findBySystemPath(TQString("/sys/devices/system/cpu/cpu%1").arg(processorNumber));
// Signal new information available
emit hardwareUpdated(hwdevice);
+ emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
}
@@ -2164,6 +2172,7 @@ 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);
emit hardwareUpdated(hwdevice);
+ emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, hwdevice->uniqueID());
}
}
}
@@ -2213,6 +2222,7 @@ 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);
@@ -2221,6 +2231,7 @@ void TDEHardwareDevices::processModifiedMounts() {
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
if (slavedevice) {
emit hardwareUpdated(slavedevice);
+ emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
}
}
}
@@ -2232,6 +2243,7 @@ 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);
@@ -2240,6 +2252,7 @@ void TDEHardwareDevices::processModifiedMounts() {
TDEGenericDevice* slavedevice = findBySystemPath(*slaveit);
if (slavedevice) {
emit hardwareUpdated(slavedevice);
+ emit hardwareEvent(TDEHardwareEvent::HardwareUpdated, slavedevice->uniqueID());
}
}
}
@@ -2247,6 +2260,7 @@ void TDEHardwareDevices::processModifiedMounts() {
}
emit mountTableModified();
+ emit hardwareEvent(TDEHardwareEvent::MountTableModified, TQString());
}
TDEDiskDeviceType::TDEDiskDeviceType classifyDiskType(udev_device* dev, const TQString devicebus, const TQString disktypestring, const TQString systempath, const TQString devicevendor, const TQString devicemodel, const TQString filesystemtype, const TQString devicedriver) {
@@ -4402,6 +4416,8 @@ bool TDEHardwareDevices::queryHardwareInformation() {
// Update parent/child tables for all devices
updateParentDeviceInformation();
+ emit hardwareEvent(TDEHardwareEvent::HardwareListModified, TQString());
+
return true;
}