Skip to content

Commit

Permalink
Merge pull request #440 from jmlich/systemd-unit-recursion
Browse files Browse the repository at this point in the history
onUnitNew is triggered with every property check.
  • Loading branch information
piggz authored Jan 15, 2025
2 parents e1443cf + 0297d86 commit a1b3671
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions ui/qml/harbour-amazfish.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,9 @@ ApplicationWindowPL
function updateProperties() {
if (ENABLE_SYSTEMD === "YES"){
var activeProperty = systemdServiceIface.getProperty("ActiveState");
if (activeProperty === "active") {
serviceActiveState = true;
} else {
serviceActiveState = false;
}

serviceActiveState = (activeProperty === "active");
var serviceEnabledProperty = systemdServiceIface.getProperty("UnitFileState");
if (serviceEnabledProperty === "enabled") {
serviceEnabledState = true;
}
else {
serviceEnabledState = false;
}
serviceEnabledState = (serviceEnabledProperty === "enabled");
}
}

Expand All @@ -144,13 +134,6 @@ ApplicationWindowPL
iface: "org.freedesktop.systemd1.Manager"
signalsEnabled: true

signal unitNew(string name)
onUnitNew: {
if (name == "harbour-amazfish.service" && ENABLE_SYSTEMD === "YES") {
systemdServiceIface.updateProperties()
}
}

function enableService() {
if(ENABLE_SYSTEMD === "YES") {
systemdManager.typedCall("EnableUnitFiles", [{"type":"as", "value":["harbour-amazfish.service"]}, {"type":"b", "value":false}, {"type":"b", "value":true}])
Expand Down

0 comments on commit a1b3671

Please sign in to comment.