dry up code

instead of repeating the removable conditional use an intermediate function
wilder-5.24
Harald Sitter 4 years ago
parent 96915c3248
commit b576ebf059
  1. 14
      applets/devicenotifier/package/contents/ui/DeviceItem.qml

@ -55,18 +55,14 @@ PlasmaExtras.ExpandableListItem {
Connections {
target: unmountAll
function onClicked() {
if (model["Removable"] && isMounted) {
actionTriggered();
}
removableActionTriggered();
}
}
Connections {
target: plasmoid.action("unmountAllDevices")
function onTriggered() {
if (model["Removable"] && isMounted) {
actionTriggered();
}
removableActionTriggered();
}
}
@ -106,6 +102,12 @@ PlasmaExtras.ExpandableListItem {
QQC2.Action { }
}
function removableActionTriggered() {
if (model["Removable"] && isMounted) {
actionTriggered();
}
}
function actionTriggered() {
var service
var operationName

Loading…
Cancel
Save