summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Surrel <[email protected]>2018-12-07 13:33:57 +0100
committerThomas Surrel <[email protected]>2019-01-08 22:41:16 +0100
commitd1a5507bd57aa74c18392354dcd43b65e15ee491 (patch)
tree7d077ebc456929631da0551088670f59faec84fc
parentcb3237987b260449647ec4e8a914e511104ed2b6 (diff)
[Device Notifier] Disable the possibility to unmount the root partition
Test Plan: {F6461150} Reviewers: #plasma, #vdg, davidedmundson, ngraham Reviewed By: #plasma, #vdg, davidedmundson, ngraham Subscribers: abetts, ngraham, broulik, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D17402
-rw-r--r--applets/devicenotifier/package/contents/ui/DeviceItem.qml2
-rw-r--r--applets/devicenotifier/package/contents/ui/FullRepresentation.qml1
2 files changed, 3 insertions, 0 deletions
diff --git a/applets/devicenotifier/package/contents/ui/DeviceItem.qml b/applets/devicenotifier/package/contents/ui/DeviceItem.qml
index 3b561aa..7dbe7b5 100644
--- a/applets/devicenotifier/package/contents/ui/DeviceItem.qml
+++ b/applets/devicenotifier/package/contents/ui/DeviceItem.qml
@@ -36,6 +36,7 @@ MouseArea {
property int state
property bool mounted
+ property bool isRoot
property bool expanded: devicenotifier.expandedDevice == udi
property alias percentUsage: freeSpaceBar.value
property string freeSpaceText
@@ -304,6 +305,7 @@ MouseArea {
PlasmaComponents.ToolButton {
id: actionButton
visible: !busyIndicator.visible && deviceItem.actionVisible
+ enabled: !isRoot
onClicked: actionTriggered()
y: mounted ? deviceLabel.height + (freeSpaceBar.height - height - units.smallSpacing) / 2 : (deviceLabel.height + actionMessage.height - height) / 2
}
diff --git a/applets/devicenotifier/package/contents/ui/FullRepresentation.qml b/applets/devicenotifier/package/contents/ui/FullRepresentation.qml
index 74fe783..dd7bc62 100644
--- a/applets/devicenotifier/package/contents/ui/FullRepresentation.qml
+++ b/applets/devicenotifier/package/contents/ui/FullRepresentation.qml
@@ -168,6 +168,7 @@ MouseArea {
}
emblemIcon: Emblems && Emblems[0] ? Emblems[0] : ""
state: sdSource.data[udi] ? sdSource.data[udi].State : 0
+ isRoot: sdSource.data[udi]["File Path"] == "/"
percentUsage: {
if (!sdSource.data[udi]) {