diff options
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); |