diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-06 02:39:07 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-04-06 02:39:07 -0500 |
commit | 63c292c62f959fd5e9349e3e9413eae01ec6efef (patch) | |
tree | 7d894948d575121f9c5df8f417592fd700e21aab | |
parent | 56591939771fdbfc0d4a2c9d79bbed454cc648a0 (diff) | |
download | tdelibs-63c292c62f959fd5e9349e3e9413eae01ec6efef.tar.gz tdelibs-63c292c62f959fd5e9349e3e9413eae01ec6efef.zip |
Add a couple of convenience functions to the TDE hw lib
-rw-r--r-- | tdecore/tdehardwaredevices.cpp | 11 | ||||
-rw-r--r-- | tdecore/tdehardwaredevices.h | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 8f33e1480..e95030983 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -199,6 +199,17 @@ void TDEGenericDevice::setBlacklistedForUpdate(bool bl) { m_blacklistedForUpdate = bl; } +TQString TDEGenericDevice::friendlyDeviceType() { + return KGlobal::hardwareDevices()->getFriendlyDeviceTypeStringFromType(type()); +} + +TQString TDEGenericDevice::busID() { + TQString busid = m_systemPath; + busid = busid.remove(0, busid.findRev("/")+1); + busid = busid.remove(0, busid.find(":")+1); + return busid; +} + TQString TDEGenericDevice::friendlyName() { if (m_friendlyName.isNull()) { if (type() == TDEGenericDeviceType::Root) { diff --git a/tdecore/tdehardwaredevices.h b/tdecore/tdehardwaredevices.h index 96ce7a995..bf474da3e 100644 --- a/tdecore/tdehardwaredevices.h +++ b/tdecore/tdehardwaredevices.h @@ -368,6 +368,16 @@ class TDECORE_EXPORT TDEGenericDevice TDEGenericDevice* parentDevice(); /** + * @return a TQString containing the friendly type name + */ + TQString friendlyDeviceType(); + + /** + * @return a TQString containing the device bus ID, if any + */ + TQString busID(); + + /** * Get an icon for this device * @param size a KIcon::StdSizes structure specifying the desired icon size * @return a TQPixmap containing the icon for the specified type |