From 659a03dff14b1c996d9a9a315b2a73781954df67 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Fri, 28 May 2021 16:16:19 -0600 Subject: [PATCH] [applets/devicenotifier] Don't allow trying to eject removable root It's possible for the root volume to be on a removable disk. In this case, don't offer the user the option to eject that disk as it does not make sense and will fail. (cherry picked from commit 740ffc8cf634b1af44a54f26db75c9fe437388b6) --- applets/devicenotifier/package/contents/ui/DeviceItem.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/applets/devicenotifier/package/contents/ui/DeviceItem.qml b/applets/devicenotifier/package/contents/ui/DeviceItem.qml index aa8a8b55c..a35856693 100644 --- a/applets/devicenotifier/package/contents/ui/DeviceItem.qml +++ b/applets/devicenotifier/package/contents/ui/DeviceItem.qml @@ -44,6 +44,8 @@ PlasmaExtras.ExpandableListItem { readonly property double totalSpace: sdSource.data[udi] && sdSource.data[udi]["Size"] ? sdSource.data[udi]["Size"] : -1.0 property bool freeSpaceKnown: freeSpace > 0 && totalSpace > 0 + readonly property bool isRootVolume: sdSource.data[udi]["File Path"] ? sdSource.data[udi]["File Path"] == "/" : false + onOperationResultChanged: { if (!popupIconTimer.running) { if (operationResult == 1) { @@ -201,7 +203,8 @@ PlasmaExtras.ExpandableListItem { } } text: { - if (!sdSource.data[udi].Removable) { + // It's possible for the root volume to be on a removable disk + if (!sdSource.data[udi].Removable || deviceItem.isRootVolume) { return i18n("Open in File Manager") } else { var types = model["Device Types"];