Преглед изворни кода

made m_index in Sensor const

Malte Veerman пре 10 година
родитељ
комит
13c394a36a
3 измењених фајлова са 14 додато и 13 уклоњено
  1. 3 3
      share/src/export.h
  2. 7 6
      share/src/sensors.cpp
  3. 4 4
      share/src/sensors.h

+ 3 - 3
share/src/export.h

@@ -1,5 +1,5 @@
-#ifndef LIBRARY_H
-#define LIBRARY_H
+#ifndef EXPORT_H
+#define EXPORT_H
 
 #if defined(FANCONTROL_GUI_LIBRARY)
 #  define FANCONTROL_GUI_EXPORT Q_DECL_EXPORT
@@ -7,5 +7,5 @@
 #  define FANCONTROL_GUI_EXPORT Q_DECL_IMPORT
 #endif
 
-#endif // LIBRARY_H
+#endif // EXPORT_H
 

+ 7 - 6
share/src/sensors.cpp

@@ -23,10 +23,10 @@
 #include <KConfigGroup>
 #include <KF5/KAuth/KAuthExecuteJob>
 
-Sensor::Sensor(Hwmon *parent, uint index) : QObject(parent)
+Sensor::Sensor(Hwmon *parent, uint index) : QObject(parent),
+                                            m_parent(parent),
+                                            m_index(index)
 {
-    m_parent = parent;
-    m_index = index;
     m_config = KSharedConfig::openConfig();
 }
 
@@ -200,7 +200,8 @@ void PwmFan::setPwmMode(int pwmMode, bool write)
                 KAuth::ExecuteJob *reply = action.execute();
 
                 if (!reply->exec())
-                    qDebug() << reply->errorString() << reply->errorText();            }
+                    qDebug() << reply->errorString() << reply->errorText();
+            }
         }
     }
 }
@@ -218,7 +219,7 @@ void PwmFan::test()
     qDebug() << "Start testing...";
 }
 
-void PwmFan::abortTesting()
+void PwmFan::abortTest()
 {
     setPwm(255);
     m_testTimer.stop();
@@ -227,7 +228,7 @@ void PwmFan::abortTesting()
     emit testingChanged();
 }
 
-void PwmFan::continueTesting()
+void PwmFan::continueTest()
 {
     update();
     switch (m_testStatus)

+ 4 - 4
share/src/sensors.h

@@ -61,7 +61,7 @@ signals:
 protected:
 
     Hwmon *m_parent;
-    uint m_index;
+    const uint m_index;
     KSharedConfigPtr m_config;
 };
 
@@ -115,7 +115,7 @@ public:
     void setName(const QString &name);
 
     virtual int pwm() const { return 255; }
-//    virtual void setPwm(int) { qDebug() << "setPwm(int) is not implemented in standard Fan"; }
+    virtual void setPwm(int, bool) { qDebug() << "setPwm(int, bool) is not implemented in standard Fan"; }
 
 
 signals:
@@ -180,7 +180,7 @@ public:
     void setActive(bool active);
     void reset();
     Q_INVOKABLE void test();
-    Q_INVOKABLE void abortTesting();
+    Q_INVOKABLE void abortTest();
 
 
 signals:
@@ -202,7 +202,7 @@ signals:
 protected slots:
 
     void update();
-    void continueTesting();
+    void continueTest();
 
 
 protected: