Browse Source

bugfixes!

Malte Veerman 10 years ago
parent
commit
f1703c1dd2
4 changed files with 8 additions and 8 deletions
  1. 3 3
      lib/src/hwmon.cpp
  2. 1 1
      lib/src/sensors.cpp
  3. 3 3
      package/contents/ui/PwmFan.qml
  4. 1 1
      package/contents/ui/PwmFansTab.qml

+ 3 - 3
lib/src/hwmon.cpp

@@ -23,10 +23,10 @@
 #include <QtQml>
 #include <QDebug>
 
-Hwmon::Hwmon(const QString &path, Loader *parent) : QObject(parent)
+Hwmon::Hwmon(const QString &path, Loader *parent) : QObject(parent),
+    m_parent(parent),
+    m_path(path)
 {
-    m_parent = parent;
-    m_path = path;
     m_index = path.split('/').last().remove("hwmon").toInt();
     QFile nameFile(path + "/name");
     if (nameFile.open(QFile::ReadOnly))

+ 1 - 1
lib/src/sensors.cpp

@@ -104,7 +104,7 @@ PwmFan::PwmFan(Hwmon *parent, uint index) : Fan(parent, index)
     connect(this, SIGNAL(maxPwmChanged()), parent, SLOT(updateConfig()));
     connect(this, SIGNAL(minStartChanged()), parent, SLOT(updateConfig()));
     connect(this, SIGNAL(minStopChanged()), parent, SLOT(updateConfig()));
-    connect(&m_testTimer, SIGNAL(timeout()), this, SLOT(continueTesting()));
+    connect(&m_testTimer, SIGNAL(timeout()), this, SLOT(continueTest()));
 
     if (QDir(parent->path()).isReadable())
     {

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

@@ -346,7 +346,7 @@ Rectangle {
                 Layout.fillWidth: true
             }
             ComboBox {
-                property var hwmon: loader.hwmons[currentIndex]
+                property QtObject hwmon: loader.hwmons[currentIndex]
 
                 id: hwmonBox
                 Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
@@ -367,11 +367,11 @@ Rectangle {
                 model: ArrayFunctions.names(hwmonBox.hwmon.temps)
                 enabled: hasTempCheckBox.checked
                 onCurrentIndexChanged: { 
-                    if (hasTempCheckBox.checked)
+                    if (hasTempCheckBox.checked && hwmonBox.hwmon)
                         fan.temp = hwmonBox.hwmon.temps[currentIndex];
                 }
                 onModelChanged: {
-                    if (hasTempCheckBox.checked)
+                    if (hasTempCheckBox.checked && hwmonBox.hwmon)
                         fan.temp = hwmonBox.hwmon.temps[currentIndex];
                 }
             }

+ 1 - 1
package/contents/ui/PwmFansTab.qml

@@ -53,7 +53,7 @@ ScrollView {
                 width: 1000 * size
                 hwRatio: 0.8
                 fan: repeater.fans[index]
-                loader: loader
+                loader: scrollView.loader
                 minTemp: scrollView.minTemp
                 maxTemp: scrollView.maxTemp
                 unit: scrollView.unit