Prechádzať zdrojové kódy

fixed service not starting or stopping

Malte Veerman 7 rokov pred
rodič
commit
467322099f

+ 4 - 6
fancontrol-gui/package/contents/ui/Application.qml

@@ -124,21 +124,19 @@ ApplicationWindow {
         id: startAction
         text: i18n("Start")
         enabled: !!Fancontrol.base.systemdCom && !Fancontrol.base.systemdCom.serviceActive
-        onTriggered: {
-            Fancontrol.base.systemdCom.serviceActive = true;
-        }
         iconName: "media-playback-start"
         tooltip: i18n("Enable manual control")
+
+        onTriggered: Fancontrol.base.systemdCom.serviceActive = true
     }
     Action {
         id: stopAction
         text: i18n("Stop")
         enabled: !!Fancontrol.base.systemdCom && Fancontrol.base.systemdCom.serviceActive
-        onTriggered: {
-            Fancontrol.base.systemdCom.serviceActive = false;
-        }
         iconName: "media-playback-stop"
         tooltip: i18n("Disable manual control")
+
+        onTriggered: Fancontrol.base.systemdCom.serviceActive = false
     }
     SystemPalette {
         id: palette

+ 1 - 5
import/qml/FanItem.qml

@@ -78,11 +78,7 @@ Rectangle {
         font.pointSize: 14
         selectByMouse: true
 
-        onTextChanged: {
-            if (!!fan) {
-                fan.name = text;
-            }
-        }
+        onTextChanged: if (!!fan && fan.name != text) fan.name = text
 
         Connections {
             target: fan

+ 1 - 1
import/src/systemdcommunicator.cpp

@@ -308,7 +308,7 @@ void SystemdCommunicator::apply(bool serviceRestart)
         if (m_serviceActive != systemdServiceActive())
         {
             QString method;
-            if (m_serviceEnabled)
+            if (m_serviceActive)
             {
                 emit info(i18n("Starting service: \'%1\'", m_serviceName));
                 method = QStringLiteral("StartUnit");