[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 740ffc8cf6)
wilder-5.22
Nate Graham 5 years ago
parent 980add1826
commit 659a03dff1
  1. 5
      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"];

Loading…
Cancel
Save