diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-03 13:38:06 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-03 13:38:06 -0500 |
commit | 8fb2978ca04635f273e725708962d06c00a59af9 (patch) | |
tree | 8edde8bcfc2e29d00a8176ba0c39913f406458a3 /tdecore/tdehardwaredevices.h | |
parent | a713cc823c957ce1fcfee82a0b8dafc7e3a2bb5b (diff) | |
download | tdelibs-8fb2978ca04635f273e725708962d06c00a59af9.tar.gz tdelibs-8fb2978ca04635f273e725708962d06c00a59af9.zip |
Build device structure in TDE hardware library
Repair potential segfault in same due to ptrlist copying
Diffstat (limited to 'tdecore/tdehardwaredevices.h')
-rw-r--r-- | tdecore/tdehardwaredevices.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tdecore/tdehardwaredevices.h b/tdecore/tdehardwaredevices.h index 5f594a8ab..bab5bd064 100644 --- a/tdecore/tdehardwaredevices.h +++ b/tdecore/tdehardwaredevices.h @@ -41,6 +41,7 @@ // Keep readGenericDeviceTypeFromString() in tdehardwaredevices.cpp in sync with this enum namespace TDEGenericDeviceType { enum TDEGenericDeviceType { + Root, CPU, GPU, RAM, @@ -270,6 +271,16 @@ class TDECORE_EXPORT TDEGenericDevice TQString &modelID(); /** + * @param a TDEGenericDevice* with the parent device, if any + */ + void setParentDevice(TDEGenericDevice* pd); + + /** + * @return a TDEGenericDevice* with the parent device, if any + */ + TDEGenericDevice* parentDevice(); + + /** * @param a TQString with the model ID, if any */ void setModelID(TQString id); @@ -286,6 +297,7 @@ class TDECORE_EXPORT TDEGenericDevice TQString m_vendorID; TQString m_modelID; bool m_blacklistedForUpdate; + TDEGenericDevice* m_parentDevice; // Internal use only! TQStringList m_externalSubtype; @@ -506,7 +518,14 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject * List all hardware capabilities on all devices * @return TQPtrList<TDEGenericDevice> containing all known hardware devices */ - TQPtrList<TDEGenericDevice> &listAllPhysicalDevices(); + TQPtrList<TDEGenericDevice> listAllPhysicalDevices(); + + /** + * List all hardware capabilities on all devices + * @param a TDEGenericDeviceType::TDEGenericDeviceType specifying the device class + * @return TQPtrList<TDEGenericDevice> containing all known hardware devices + */ + TQPtrList<TDEGenericDevice> listByDeviceClass(TDEGenericDeviceType::TDEGenericDeviceType cl); /** * Return the device with system path @arg syspath, or 0 if no device exists for that path @@ -544,6 +563,11 @@ class TDECORE_EXPORT TDEHardwareDevices : public TQObject TDEGenericDevice *classifyUnknownDevice(udev_device* dev, TDEGenericDevice* existingdevice=0, bool force_full_classification=true); TDEGenericDevice *classifyUnknownDeviceByExternalRules(udev_device* dev, TDEGenericDevice* existingdevice=0, bool classifySubDevices=false); + void updateParentDeviceInformation(); + void updateParentDeviceInformation(TDEGenericDevice* hwdevice); + + void addCoreSystemDevices(); + struct udev *m_udevStruct; struct udev_monitor *m_udevMonitorStruct; TDEGenericHardwareList m_deviceList; |