tdehw lib: fixed detection of mountable optical disks with incomplete

partition table.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/113/head
Michele Calgaro 4 years ago
parent 07200a5475
commit 99b855062b
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -2775,7 +2775,8 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable; 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; diskstatus = diskstatus | TDEDiskDeviceStatus::ContainsFilesystem;
} }
else { else {
@ -2802,11 +2803,12 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice *devic
diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable; diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
} }
// Partition tables cannot be mounted // Partition tables cannot be mounted
if ((TQString(udev_device_get_property_value(dev, "ID_PART_TABLE_TYPE")) != "") 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()) ((TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")).isEmpty() &&
|| (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0x5") !(diskstatus & TDEDiskDeviceStatus::ContainsFilesystem)) ||
|| (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0xf") (TQString(udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")) == "0x5") ||
|| (TQString(udev_device_get_property_value(dev, "ID_FS_USAGE")).upper() == "RAID"))) { (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; diskstatus = diskstatus & ~TDEDiskDeviceStatus::Mountable;
} }
// If certain disk types do not report the presence of a filesystem, they are likely not mountable // If certain disk types do not report the presence of a filesystem, they are likely not mountable

Loading…
Cancel
Save