From 111cc009ea9a3699dcdda42503efc284e0d58098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 27 Jan 2016 23:08:57 +0100 Subject: [PATCH] Fix ZIP drive classification in tdehwlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 6dfc04c51a9c2086e2f6a4be75ec847e8ef9f6fb) --- tdecore/tdehw/tdehardwaredevices.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index 89d9232ee..e0b594f49 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -1014,16 +1014,21 @@ TDEDiskDeviceType::TDEDiskDeviceType classifyDiskType(udev_device* dev, const TQ disktype = disktype | TDEDiskDeviceType::USB; } + if (disktypestring.upper() == "DISK") { + disktype = disktype | TDEDiskDeviceType::HDD; + } + if ((disktypestring.upper() == "FLOPPY") || (TQString(udev_device_get_property_value(dev, "ID_DRIVE_FLOPPY")) == "1")) { disktype = disktype | TDEDiskDeviceType::Floppy; + disktype = disktype & ~TDEDiskDeviceType::HDD; } - if (disktypestring.upper() == "ZIP") { - disktype = disktype | TDEDiskDeviceType::Zip; - } - if ((devicevendor.upper() == "IOMEGA") && (devicemodel.upper().contains("ZIP"))) { + if ((disktypestring.upper() == "ZIP") + || (TQString(udev_device_get_property_value(dev, "ID_DRIVE_FLOPPY_ZIP")) == "1") + || ((devicevendor.upper() == "IOMEGA") && (devicemodel.upper().contains("ZIP")))) { disktype = disktype | TDEDiskDeviceType::Zip; + disktype = disktype & ~TDEDiskDeviceType::HDD; } if ((devicevendor.upper() == "APPLE") && (devicemodel.upper().contains("IPOD"))) { @@ -1077,10 +1082,6 @@ TDEDiskDeviceType::TDEDiskDeviceType classifyDiskType(udev_device* dev, const TQ disktype = disktype | TDEDiskDeviceType::Jaz; } - if (disktypestring.upper() == "DISK") { - disktype = disktype | TDEDiskDeviceType::HDD; - } - if (disktypestring.upper() == "CD") { disktype = disktype | TDEDiskDeviceType::Optical;