diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-01-31 16:35:26 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-01-31 16:35:39 +0100 |
commit | 9b33264c99979c526a0660eecc071ad8f2678ea4 (patch) | |
tree | fee02b62724c21fd8948d4183e11f9942157e495 /tdecore/tdehw/tdehardwaredevices.cpp | |
parent | fd96a6c2a8509afe19221213b3941a63d33a4ee4 (diff) | |
download | tdelibs-9b33264c99979c526a0660eecc071ad8f2678ea4.tar.gz tdelibs-9b33264c99979c526a0660eecc071ad8f2678ea4.zip |
Force removable flag for flask disks in tdehwlib
This resolves Bug 2473
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit dc350e6c6406a78621763c2d4fcbea8deca01c7c)
Diffstat (limited to 'tdecore/tdehw/tdehardwaredevices.cpp')
-rw-r--r-- | tdecore/tdehw/tdehardwaredevices.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index 26dc010f5..4aca70439 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -2656,6 +2656,16 @@ void TDEHardwareDevices::updateExistingDeviceInformation(TDEGenericDevice* exist if (hotpluggable) { diskstatus = diskstatus | TDEDiskDeviceStatus::Hotpluggable; } + // Force removable flag for flash disks + // udev reports disks as non-removable for card readers on PCI controllers + if (((disktype & TDEDiskDeviceType::CompactFlash) + || (disktype & TDEDiskDeviceType::MemoryStick) + || (disktype & TDEDiskDeviceType::SmartMedia) + || (disktype & TDEDiskDeviceType::SDMMC)) + && !(diskstatus & TDEDiskDeviceStatus::Removable) + && !(diskstatus & TDEDiskDeviceStatus::Hotpluggable)) { + diskstatus = diskstatus | TDEDiskDeviceStatus::Removable; + } if ((filesystemtype.upper() != "CRYPTO_LUKS") && (filesystemtype.upper() != "CRYPTO") && (filesystemtype.upper() != "SWAP") && (!filesystemtype.isNull())) { diskstatus = diskstatus | TDEDiskDeviceStatus::ContainsFilesystem; |