diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-01-23 04:25:40 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-01-23 04:25:53 +0100 |
commit | ad6b5add68f544725f52317cc25af7cc8e9e45f1 (patch) | |
tree | 6a2dafa070bd7305395b2b04ae7d21f7858ecedc /tdecore/tdehw | |
parent | 10f97f0a4244cbeda4e72820e6dba0e6f15f8ae0 (diff) | |
download | tdelibs-ad6b5add68f544725f52317cc25af7cc8e9e45f1.tar.gz tdelibs-ad6b5add68f544725f52317cc25af7cc8e9e45f1.zip |
Fix disk type clasification in tdehwlib
This resolves Bug 2473
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 68102d50e99fe35442f78be21cf8b720481e7e0b)
Diffstat (limited to 'tdecore/tdehw')
-rw-r--r-- | tdecore/tdehw/tdehardwaredevices.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index 3fc8e42b0..5c6ad9e27 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -1067,20 +1067,8 @@ TDEDiskDeviceType::TDEDiskDeviceType classifyDiskType(udev_device* dev, const TQ if (disktypestring.upper() == "DISK") { disktype = disktype | TDEDiskDeviceType::HDD; } - if (disktypestring.isNull()) { - // Fallback - // If we can't recognize the disk type then set it as a simple HDD volume - disktype = disktype | TDEDiskDeviceType::HDD; - } - - // Certain combinations of media flags should never be set at the same time as they don't make sense - // This block is needed as udev is more than happy to provide inconsistent data to us - if ((disktype & TDEDiskDeviceType::Zip) || (disktype & TDEDiskDeviceType::Floppy) || (disktype & TDEDiskDeviceType::Jaz) || (disktype & TDEDiskDeviceType::Tape)) { - disktype = disktype & ~TDEDiskDeviceType::HDD; - } if (disktypestring.upper() == "CD") { - disktype = disktype & ~TDEDiskDeviceType::HDD; disktype = disktype | TDEDiskDeviceType::Optical; if (TQString(udev_device_get_property_value(dev, "ID_CDROM_MEDIA")) == "1") { @@ -1250,6 +1238,12 @@ TDEDiskDeviceType::TDEDiskDeviceType classifyDiskType(udev_device* dev, const TQ disktype = disktype | TDEDiskDeviceType::Loop; } + if (disktype == TDEDiskDeviceType::Null) { + // Fallback + // If we can't recognize the disk type then set it as a simple HDD volume + disktype = disktype | TDEDiskDeviceType::HDD; + } + if (filesystemtype.upper() == "CRYPTO_LUKS") { disktype = disktype | TDEDiskDeviceType::LUKS; } |