Explorar o código

Merge branch 'master' of https://github.com/Maldela/Fancontrol-GUI

Malte Veerman %!s(int64=9) %!d(string=hai) anos
pai
achega
ea5ea512aa
Modificáronse 5 ficheiros con 14 adicións e 14 borrados
  1. 8 7
      helper/src/helper.cpp
  2. 3 3
      lib/src/config.cpp
  3. 1 1
      lib/src/guibase.cpp
  4. 0 1
      lib/src/hwmon.cpp
  5. 2 2
      package/contents/ui/PwmFan.qml

+ 8 - 7
helper/src/helper.cpp

@@ -22,6 +22,7 @@
 #include <QtCore/QFile>
 #include <QtCore/QTextStream>
 #include <QtCore/QProcess>
+#include <QtCore/QFileInfo>
 
 #include <KAuth/KAuthHelperSupport>
 #include <KI18n/KLocalizedString>
@@ -108,34 +109,34 @@ ActionReply Helper::action(const QVariantMap &arguments)
     {
         QString program = QStringLiteral("sensors-detect");
         QStringList arguments = QStringList() << QStringLiteral("--auto");
-        
+
         QProcess process;
         process.start(program, arguments);
 
-        if (!process.waitForStarted(10000))
+        if (!process.waitForStarted(1000))
         {
             reply = ActionReply::HelperErrorType;
             reply.setErrorDescription(process.errorString());
-            
+
             return reply;
         }
-        
+
         if (!process.waitForFinished(10000))
         {
             reply = ActionReply::HelperErrorType;
             reply.setErrorDescription(process.errorString());
-            
+
             return reply;
         }
     }
-    
+
     else
     {
         reply.setType(ActionReply::HelperErrorType);
         reply.setErrorCode(ActionReply::NoSuchActionError);
         reply.setErrorDescription(i18n("This action does not exist!"));
     }
-    
+
     return reply;
 }
 

+ 3 - 3
lib/src/config.cpp

@@ -47,8 +47,8 @@ Config::Config(QObject *parent) : KCoreConfigSkeleton(KSharedConfig::openConfig(
     addItemDouble(QStringLiteral("MinTemp"), m_minTemp, 30.0);
     addItemDouble(QStringLiteral("MaxTemp"), m_maxTemp, 90.0);
     addItemString(QStringLiteral("ServiceName"), m_serviceName, QStringLiteral(STANDARD_SERVICE_NAME));
-    addItemPath(QStringLiteral("ConfigUrl"), m_configUrl, QStringLiteral("file://") + QStringLiteral(STANDARD_CONFIG_FILE));
-    
+    addItemPath(QStringLiteral("ConfigUrl"), m_configUrl, QStringLiteral("file://") + STANDARD_CONFIG_FILE);
+
     load();
 }
 
@@ -56,7 +56,7 @@ Config* Config::instance()
 {
     if (!m_instance)
         m_instance = new Config;
-    
+
     return m_instance;
 }
 

+ 1 - 1
lib/src/guibase.cpp

@@ -49,7 +49,7 @@ GUIBase::GUIBase(QObject *parent) : QObject(parent),
 
     QLocale locale = QLocale::system();
     QLocale::MeasurementSystem system = locale.measurementSystem();
-    m_unit = (system == QLocale::MetricSystem) ? 0 : 2;
+    m_unit = (system != QLocale::ImperialUSSystem) ? 0 : 2;
 
     qmlRegisterType<Loader>();
     qmlRegisterType<Hwmon>();

+ 0 - 1
lib/src/hwmon.cpp

@@ -80,7 +80,6 @@ void Hwmon::initialize()
                     if (pwmFan->index() == index)
                     {
                         newPwmFan = pwmFan;
-                        newPwmFan->reset();
                         break;
                     }
                 }

+ 2 - 2
package/contents/ui/PwmFan.qml

@@ -210,8 +210,8 @@ Rectangle {
                     if (fanOffCheckBox.checked) {
                         c.moveTo(stopPoint.centerX, height);
                     } else {
-                        c.moveTo(0, scaleY(fan.minPwm));
-                        c.lineTo(stopPoint.centerX, scaleY(fan.minPwm));
+                        c.moveTo(0, stopPoint.centerY);
+                        c.lineTo(stopPoint.centerX, stopPoint.centerY);
                     }
                     c.lineTo(stopPoint.centerX, stopPoint.centerY);
                     c.lineTo(maxPoint.centerX, maxPoint.centerY);