From dc350e6c6406a78621763c2d4fcbea8deca01c7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 31 Jan 2016 16:35:26 +0100 Subject: Force removable flag for flask disks in tdehwlib This resolves Bug 2473 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdecore/tdehw/tdehardwaredevices.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tdecore') diff --git a/tdecore/tdehw/tdehardwaredevices.cpp b/tdecore/tdehw/tdehardwaredevices.cpp index f121bec3c..8ec1a5286 100644 --- a/tdecore/tdehw/tdehardwaredevices.cpp +++ b/tdecore/tdehw/tdehardwaredevices.cpp @@ -2710,6 +2710,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; -- cgit v1.2.1