summaryrefslogtreecommitdiffstats
path: root/tdecore
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-01-23 04:37:47 +0100
committerSlávek Banko <slavek.banko@axis.cz>2016-01-23 04:38:00 +0100
commitcec0b42a3c26cd4d3cd129fe856464c67a94e101 (patch)
tree9b72020827d40f01e1b3717026c2e19f85e53b32 /tdecore
parentbec14c7a286a644f804000c97275de9284051641 (diff)
downloadtdelibs-cec0b42a3c26cd4d3cd129fe856464c67a94e101.tar.gz
tdelibs-cec0b42a3c26cd4d3cd129fe856464c67a94e101.zip
Prefer encoded disk labels in tdehwlib
because it contains unadjusted disk labels Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 893ac9fad0249a9ed959e2e8e28952415291b3a2)
Diffstat (limited to 'tdecore')
-rw-r--r--tdecore/tdehw/tdehardwaredevices.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index 7f30b6b92..1ad200c68 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -115,6 +115,9 @@ unsigned int reverse_bits(register unsigned int x)
return((x >> 16) | (x << 16));
}
+// Helper function implemented in tdestoragedevice.cpp
+TQString decodeHexEncoding(TQString str);
+
#if defined(WITH_TDEHWLIB_DAEMONS) || defined(WITH_UDISKS) || defined(WITH_UDISKS2) || defined(WITH_NETWORK_MANAGER_BACKEND)
#include <tqdbusvariant.h>
#include <tqdbusdata.h>
@@ -2516,7 +2519,10 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist
TQString devicebus(udev_device_get_property_value(dev, "ID_BUS"));
// Get disk specific info
- TQString disklabel(TQString::fromLocal8Bit(udev_device_get_property_value(dev, "ID_FS_LABEL")));
+ TQString disklabel(decodeHexEncoding(TQString::fromLocal8Bit(udev_device_get_property_value(dev, "ID_FS_LABEL_ENC"))));
+ if (disklabel == "") {
+ disklabel = TQString::fromLocal8Bit(udev_device_get_property_value(dev, "ID_FS_LABEL"));
+ }
TQString diskuuid(udev_device_get_property_value(dev, "ID_FS_UUID"));
TQString filesystemtype(udev_device_get_property_value(dev, "ID_FS_TYPE"));
TQString filesystemusage(udev_device_get_property_value(dev, "ID_FS_USAGE"));