summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-11-22 20:12:09 +0800
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-11-22 20:12:09 +0800
commit99b855062b2a684a88b4c2b85a4a548ce66793be (patch)
treef1ae86283724ac9d5c1d821c21f5d25aa8a6e4b0 /tdecore/tdehw
parent07200a5475b2c7634d1c7b3d28d6cdbdca653bd7 (diff)
downloadtdelibs-99b855062b2a684a88b4c2b85a4a548ce66793be.tar.gz
tdelibs-99b855062b2a684a88b4c2b85a4a548ce66793be.zip
tdehw lib: fixed detection of mountable optical disks with incomplete
partition table. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdecore/tdehw')
-rw-r--r--tdecore/tdehw/tdehardwaredevices.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp
index 3f694cedc..28a0f44d2 100644
--- a/tdecore/tdehw/tdehardwaredevices.cpp
+++ b/tdecore/tdehw/tdehardwaredevices.cpp
@@ -2775,7 +2775,8 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable;
}
- if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (filesystemtype.upper() != "SWAP") && (!filesystemtype.isEmpty())) {
+ if ((!filesystemtype.isEmpty()) && (filesystemtype.upper() != "CRYPTO_LUKS") &&
+ (filesystemtype.upper() != "CRYPTO") && (filesystemtype.upper() != "SWAP")) {
diskstatus = diskstatus | TDEDiskDeviceStatus::ContainsFilesystem;
}
else {
@@ -2802,11 +2803,12 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
}
// Partition tables cannot be mounted
- if ((TQString(udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")) != "")
- && ((TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")).isEmpty())
- || (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0x5")
- || (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0xf")
- || (TQString(udev_device_get_property_value(dev, "ID_FS_USAGE")).upper() == "RAID"))) {
+ if ((!TQString(udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")).isEmpty()) &&
+ ((TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")).isEmpty() &&
+ !(diskstatus & TDEDiskDeviceStatus::ContainsFilesystem)) ||
+ (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0x5") ||
+ (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0xf") ||
+ (TQString(udev_device_get_property_value(dev, "ID_FS_USAGE")).upper() == "RAID"))) {
diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
}
// If certain disk types do not report the presence of a filesystem, they are likely not mountable