diff options
author | Alexander Golubev <[email protected]> | 2023-12-19 21:20:24 +0300 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-12-28 10:32:59 +0900 |
commit | dff837200eae3d2fdd7fbf8f39fbe41d5ecb2d8d (patch) | |
tree | b2a9f827a3c6ee7a2ef3fb87549cd159f38b1dc6 /tdecore/tdehw/tdestoragedevice.cpp | |
parent | 2a3a62bb995b73481a8a64658266adf22e523f7b (diff) | |
download | tdelibs-dff837200eae3d2fdd7fbf8f39fbe41d5ecb2d8d.tar.gz tdelibs-dff837200eae3d2fdd7fbf8f39fbe41d5ecb2d8d.zip |
Fix lvm volumes appearing as removable devices
- remove obsolete/erroneous code meddling with
GENHD_FL_MEDIA_CHANGE_NOTIFY
- use /sys/block/<dev>/removable rather than
/sys/block/<dev>/capabilities
- deprecate TDEDiskDeviceStatus::Hotpluggable and use
TDEDiskDeviceStatus::Removable for all removable devices
- put some local utility function into anonymous namespace
See https://mirror.git.trinitydesktop.org/gitea/TDE/tde/issues/148
Signed-off-by: Alexander Golubev <[email protected]>
(cherry picked from commit 14573faf07515b472f86dff585bd8a14fa1f25d7)
Diffstat (limited to 'tdecore/tdehw/tdestoragedevice.cpp')
-rw-r--r-- | tdecore/tdehw/tdestoragedevice.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tdecore/tdehw/tdestoragedevice.cpp b/tdecore/tdehw/tdestoragedevice.cpp index 08fb246e1..df5f90ab7 100644 --- a/tdecore/tdehw/tdestoragedevice.cpp +++ b/tdecore/tdehw/tdestoragedevice.cpp @@ -504,7 +504,7 @@ TQString TDEStorageDevice::friendlyName() { TQString label = diskLabel(); if (label.isNull()) { if (deviceSize() > 0) { - if (checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) { + if (checkDiskStatus(TDEDiskDeviceStatus::Removable)) { label = i18n("%1 Removable Device").arg(deviceFriendlySize()); } else { @@ -561,7 +561,7 @@ TQString TDEStorageDevice::friendlyDeviceType() { if (isDiskOfType(TDEDiskDeviceType::HDD)) { ret = i18n("Hard Disk Drive"); - if (checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) { + if (checkDiskStatus(TDEDiskDeviceStatus::Removable)) { ret = i18n("Removable Storage"); } if (isDiskOfType(TDEDiskDeviceType::CompactFlash)) { @@ -632,7 +632,7 @@ TQPixmap TDEStorageDevice::icon(TDEIcon::StdSizes size) { if (isDiskOfType(TDEDiskDeviceType::HDD)) { ret = DesktopIcon("drive-harddisk" + mountString, size); - if (checkDiskStatus(TDEDiskDeviceStatus::Hotpluggable)) { + if (checkDiskStatus(TDEDiskDeviceStatus::Removable)) { ret = DesktopIcon("media-flash-usb" + mountString, size); } if (isDiskOfType(TDEDiskDeviceType::CompactFlash)) { |