diff options
author | Michele Calgaro <[email protected]> | 2020-10-10 14:31:22 +0800 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2020-10-10 14:31:24 +0800 |
commit | 33794c4ec3572327ac077e272523234aac464aa2 (patch) | |
tree | 0a6d84fcd46310059cc8cebfda669efcd7085abe /tdecore/tdehw/tdehardwaredevices.cpp | |
parent | fe08361f7e4227def5699ee7c911a61b84f5a77b (diff) | |
download | tdelibs-33794c4ec3572327ac077e272523234aac464aa2.tar.gz tdelibs-33794c4ec3572327ac077e272523234aac464aa2.zip |
Fixed displaying of encrypted disks.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.cpp')
-rw-r--r-- | tdecore/tdehw/tdehardwaredevices.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index f0069d38f..acdd67b8a 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -2626,6 +2626,15 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist device = classifyUnknownDeviceByExternalRules(dev, device, true); // Check external rules for possible subtype overrides disktype = sdevice->diskType(); // The type can be overridden by an external rule + // Set unlocked crypt flag is device has any holders + if ((filesystemtype.upper() == "CRYPTO_LUKS" || filesystemtype.upper() == "CRYPTO") && + holdingDeviceNodes.count() > 0) { + disktype = disktype | TDEDiskDeviceType::UnlockedCrypt; + } + else { + disktype = disktype & ~TDEDiskDeviceType::UnlockedCrypt; + } + if (TQString(udev_device_get_property_value(dev, "UDISKS_IGNORE")) == "1") { diskstatus = diskstatus | TDEDiskDeviceStatus::Hidden; } @@ -2796,17 +2805,6 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist } // See if any slaves were crypted - for ( TQStringList::Iterator slaveit = slaveDeviceNodes.begin(); slaveit != slaveDeviceNodes.end(); ++slaveit ) { - struct udev_device *slavedev; - slavedev = udev_device_new_from_syspath(m_udevStruct, (*slaveit).ascii()); - TQString slavediskfstype(udev_device_get_property_value(slavedev, "ID_FS_TYPE")); - if ((slavediskfstype.upper() == "CRYPTO_LUKS") || (slavediskfstype.upper() == "CRYPTO")) { - disktype = disktype | TDEDiskDeviceType::UnlockedCrypt; - // Set disk type based on parent device - disktype = disktype | classifyDiskType(slavedev, devicenode, TQString(udev_device_get_property_value(dev, "ID_BUS")), TQString(udev_device_get_property_value(dev, "ID_TYPE")), (*slaveit), TQString(udev_device_get_property_value(dev, "ID_VENDOR")), TQString(udev_device_get_property_value(dev, "ID_MODEL")), TQString(udev_device_get_property_value(dev, "ID_FS_TYPE")), TQString(udev_device_get_driver(dev))); - } - udev_device_unref(slavedev); - } sdevice->internalSetDiskType(disktype); sdevice->internalSetDiskUUID(diskuuid); |