Ver código fonte

fixed some issues with fancontrol at start asking for permissions

Maldela 8 anos atrás
pai
commit
a3535b9a12
2 arquivos alterados com 11 adições e 6 exclusões
  1. 3 2
      import/src/loader.cpp
  2. 8 4
      import/src/pwmfan.cpp

+ 3 - 2
import/src/loader.cpp

@@ -31,6 +31,7 @@
 #include <QtCore/QTextStream>
 #include <QtCore/QTimer>
 #include <QtCore/QProcess>
+#include <QtCore/QDebug>
 
 #include <KAuth/KAuthExecuteJob>
 #include <KI18n/KLocalizedString>
@@ -476,7 +477,7 @@ bool Loader::load(const QUrl &url)
             {
                 if (reply->error() == 4)
                 {
-//                    qDebug() << "Aborted by user";
+                    qDebug() << "Loading of file aborted by user";
                     return false;
                 }
 
@@ -548,7 +549,7 @@ bool Loader::save(const QUrl &url)
             {
                 if (reply->error() == 4)
                 {
-//                    qDebug() << "Aborted by user";
+                    qDebug() << "Saving of file aborted by user";
                     return false;
                 }
 

+ 8 - 4
import/src/pwmfan.cpp

@@ -140,8 +140,8 @@ void PwmFan::reset()
 
     setHasTemp(false);
     setTemp(Q_NULLPTR);
-    setPwm(0);
-    setPwmEnable(0, true);
+    setPwm(0, false);
+    setPwmEnable(0, false);
     setMinTemp(0);
     setMaxTemp(100);
     setMinPwm(255);
@@ -149,8 +149,12 @@ void PwmFan::reset()
     setMinStart(255);
     setMinStop(255);
     m_zeroRpm = 0;
-    m_testStatus = NotStarted;
-    emit testStatusChanged();
+
+    if (m_testStatus != NotStarted)
+    {
+        m_testStatus = NotStarted;
+        emit testStatusChanged();
+    }
 
     if (m_pwmStream->device() && m_enableStream->device() && m_parent)
     {