Browse Source

minor cleanups and fixes

Maldela 9 years ago
parent
commit
5acc6e884e
3 changed files with 3 additions and 12 deletions
  1. 0 1
      lib/src/pwmfanmodel.h
  2. 1 9
      lib/src/tempmodel.cpp
  3. 2 2
      package/contents/ui/PwmFansTab.qml

+ 0 - 1
lib/src/pwmfanmodel.h

@@ -28,7 +28,6 @@
 #include <QtCore/QStringListModel>
 
 
-
 namespace Fancontrol {
 
 

+ 1 - 9
lib/src/tempmodel.cpp

@@ -97,15 +97,7 @@ void TempModel::updateTemp()
 {
     Temp *temp = qobject_cast<Temp *>(sender());
 
-    if (!temp)
-        return;
-
-    int i = m_temps.indexOf(temp);
-    if (i == -1)
-        return;
-
-    setData(index(i, 0), composeText(temp));
-    emit dataChanged(index(i, 0), index(i, 0));
+    updateTemp(temp);
 }
 
 void TempModel::updateAll()

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

@@ -37,7 +37,7 @@ ColumnLayout {
 
     RowLayout {
         width: parent.width
-        visible: loader && pwmFanModel.count > 0
+        visible: !!loader && !!pwmFanModel && pwmFanModel.count > 0
 
         Label {
             text: i18n("Fan:")
@@ -60,7 +60,7 @@ ColumnLayout {
     Loader {
         Layout.fillHeight: true
         Layout.fillWidth: true
-        active: !!loader && !!systemdCom && !!pwmFans[fanComboBox.currentIndex]
+        active: !!loader && !!systemdCom && !!pwmFans && !!pwmFans[fanComboBox.currentIndex]
 
         sourceComponent: PwmFan {
             unit: !!baseObject ? baseObject.unit : 0