Browse Source

error handling cleanup

Malte Veerman 9 years ago
parent
commit
1940be8974

+ 2 - 2
import/src/fan.cpp

@@ -49,7 +49,7 @@ Fan::Fan(Hwmon *parent, uint index) :
         else
         else
         {
         {
             delete rpmFile;
             delete rpmFile;
-            emit errorChanged("Can't open rpmFile: " + parent->path() + "/fan" + QString::number(index) + "_input");
+            emit error("Can't open rpmFile: " + parent->path() + "/fan" + QString::number(index) + "_input");
         }
         }
     }
     }
 }
 }
@@ -102,7 +102,7 @@ void Fan::reset()
         else
         else
         {
         {
             delete rpmFile;
             delete rpmFile;
-            emit errorChanged("Can't open rpmFile: " + m_parent->path() + "/fan" + QString::number(m_index) + "_input");
+            emit error("Can't open rpmFile: " + m_parent->path() + "/fan" + QString::number(m_index) + "_input");
         }
         }
     }
     }
 }
 }

+ 1 - 1
import/src/guibase.cpp

@@ -167,7 +167,7 @@ bool GUIBase::hasSystemdCommunicator() const
 #endif
 #endif
 }
 }
 
 
-void GUIBase::setError(const QString &error, bool critical)
+void GUIBase::handleError(const QString &error, bool critical)
 {
 {
     if (error.isEmpty() || error == m_error)
     if (error.isEmpty() || error == m_error)
         return;
         return;

+ 1 - 1
import/src/guibase.h

@@ -91,7 +91,7 @@ public slots:
     
     
     void save(bool saveLoader = false, const QUrl &url = QUrl());
     void save(bool saveLoader = false, const QUrl &url = QUrl());
     void load();
     void load();
-    void setError(const QString &error, bool critical = false);
+    void handleError(const QString &error, bool critical = false);
     
     
     
     
 signals:
 signals:

+ 4 - 9
import/src/hwmon.cpp

@@ -37,7 +37,7 @@ Hwmon::Hwmon(const QString &path, Loader *parent) : QObject(parent),
     QDir dir(path);
     QDir dir(path);
     if (!dir.isReadable())
     if (!dir.isReadable())
     {
     {
-        emit errorChanged(path + " is not readable!");
+        emit error(path + " is not readable!");
         m_valid = false;
         m_valid = false;
     }
     }
 
 
@@ -46,7 +46,7 @@ Hwmon::Hwmon(const QString &path, Loader *parent) : QObject(parent),
 
 
     if (!success)
     if (!success)
     {
     {
-        emit errorChanged(path + "is invalid!");
+        emit error(path + "is invalid!");
         m_valid = false;
         m_valid = false;
     }
     }
 
 
@@ -62,7 +62,7 @@ Hwmon::Hwmon(const QString &path, Loader *parent) : QObject(parent),
     connect(this, &Hwmon::configUpdateNeeded, parent, &Loader::createConfigFile);
     connect(this, &Hwmon::configUpdateNeeded, parent, &Loader::createConfigFile);
     connect(this, &Hwmon::pwmFansChanged, parent, &Loader::emitAllPwmFansChanged);
     connect(this, &Hwmon::pwmFansChanged, parent, &Loader::emitAllPwmFansChanged);
     connect(this, &Hwmon::tempsChanged, parent, &Loader::emitAllTempsChanged);
     connect(this, &Hwmon::tempsChanged, parent, &Loader::emitAllTempsChanged);
-    connect(this, &Hwmon::errorChanged, parent, &Loader::setError);
+    connect(this, &Hwmon::error, parent, &Loader::error);
 
 
     if (m_valid)
     if (m_valid)
         initialize();
         initialize();
@@ -83,7 +83,7 @@ void Hwmon::initialize()
 
 
         if (!success)
         if (!success)
         {
         {
-            emit errorChanged("Not a valid Sensor:" + entry);
+            emit error("Not a valid Sensor:" + entry);
             continue;
             continue;
         }
         }
 
 
@@ -228,11 +228,6 @@ Temp* Hwmon::temp(int i) const
     return m_temps.value(i, Q_NULLPTR);
     return m_temps.value(i, Q_NULLPTR);
 }
 }
 
 
-void Hwmon::setError(const QString &error, bool critical)
-{
-    emit errorChanged(error, critical);
-}
-
 bool Hwmon::testing() const
 bool Hwmon::testing() const
 {
 {
     auto testing = false;
     auto testing = false;

+ 1 - 2
import/src/hwmon.h

@@ -73,7 +73,6 @@ public slots:
 
 
     void updateConfig() { emit configUpdateNeeded(); }
     void updateConfig() { emit configUpdateNeeded(); }
     void updateSensors() { emit sensorsUpdateNeeded(); }
     void updateSensors() { emit sensorsUpdateNeeded(); }
-    void setError(const QString &error, bool critical = false);
 
 
 
 
 signals:
 signals:
@@ -83,7 +82,7 @@ signals:
     void tempsChanged();
     void tempsChanged();
     void configUpdateNeeded();
     void configUpdateNeeded();
     void sensorsUpdateNeeded();
     void sensorsUpdateNeeded();
-    void errorChanged(QString, bool = false);
+    void error(QString, bool = false);
 
 
 
 
 private:
 private:

+ 26 - 31
import/src/loader.cpp

@@ -52,7 +52,7 @@ Loader::Loader(GUIBase *parent) : QObject(parent),
     m_sensorsDetected(false)
     m_sensorsDetected(false)
 {
 {
     if (parent)
     if (parent)
-        connect(this, &Loader::errorChanged, parent, &GUIBase::setError);
+        connect(this, &Loader::error, parent, &GUIBase::handleError);
 
 
     parseHwmons();
     parseHwmons();
 
 
@@ -71,12 +71,12 @@ void Loader::parseHwmons()
 
 
     else if (hwmonDir.exists())
     else if (hwmonDir.exists())
     {
     {
-        emit errorChanged(i18n("%1 is not readable!", QStringLiteral(HWMON_PATH)), true);
+        emit error(i18n("%1 is not readable!", QStringLiteral(HWMON_PATH)), true);
         return;
         return;
     }
     }
     else
     else
     {
     {
-        emit errorChanged(i18n("%1 does not exist!", QStringLiteral(HWMON_PATH)), true);
+        emit error(i18n("%1 does not exist!", QStringLiteral(HWMON_PATH)), true);
         return;
         return;
     }
     }
 
 
@@ -152,7 +152,7 @@ QPair<int, int> Loader::getEntryNumbers(const QString &entry)
     auto list = entry.split('/', QString::SkipEmptyParts);
     auto list = entry.split('/', QString::SkipEmptyParts);
     if (list.size() != 2)
     if (list.size() != 2)
     {
     {
-        emit errorChanged(i18n("Invalid entry to parse: %1", entry));
+        emit error(i18n("Invalid entry to parse: %1", entry));
         return QPair<int, int>(-1, -1);
         return QPair<int, int>(-1, -1);
     }
     }
     auto &hwmon = list[0];
     auto &hwmon = list[0];
@@ -160,12 +160,12 @@ QPair<int, int> Loader::getEntryNumbers(const QString &entry)
 
 
     if (!hwmon.startsWith(QStringLiteral("hwmon")))
     if (!hwmon.startsWith(QStringLiteral("hwmon")))
     {
     {
-        emit errorChanged(i18n("Invalid entry to parse: %1", entry));
+        emit error(i18n("Invalid entry to parse: %1", entry));
         return QPair<int, int>(-1, -1);
         return QPair<int, int>(-1, -1);
     }
     }
     if (!sensor.contains(QRegExp("^(pwm|fan|temp)\\d+")))
     if (!sensor.contains(QRegExp("^(pwm|fan|temp)\\d+")))
     {
     {
-        emit errorChanged(i18n("Invalid entry to parse: %1", entry));
+        emit error(i18n("Invalid entry to parse: %1", entry));
         return QPair<int, int>(-1, -1);
         return QPair<int, int>(-1, -1);
     }
     }
 
 
@@ -178,13 +178,13 @@ QPair<int, int> Loader::getEntryNumbers(const QString &entry)
     const auto hwmonResult = hwmon.toInt(&success);
     const auto hwmonResult = hwmon.toInt(&success);
     if (!success)
     if (!success)
     {
     {
-        emit errorChanged(i18n("Invalid entry to parse: %1", entry));
+        emit error(i18n("Invalid entry to parse: %1", entry));
         return QPair<int, int>(-1, -1);
         return QPair<int, int>(-1, -1);
     }
     }
     const auto sensorResult = sensor.toInt(&success);
     const auto sensorResult = sensor.toInt(&success);
     if (!success)
     if (!success)
     {
     {
-        emit errorChanged(i18n("Invalid entry to parse: %1", entry));
+        emit error(i18n("Invalid entry to parse: %1", entry));
         return QPair<int, int>(-1, -1);
         return QPair<int, int>(-1, -1);
     }
     }
 
 
@@ -215,10 +215,10 @@ void Loader::parseConfigLine(const QString &line, void (PwmFan::*memberSetFuncti
                     (fan->*memberSetFunction)(value);
                     (fan->*memberSetFunction)(value);
             }
             }
             else
             else
-                emit errorChanged(valueString + " is not an int");
+                emit error(valueString + " is not an int");
         }
         }
         else
         else
-            emit errorChanged(i18n("Invalid entry to parse: %1", entry));
+            emit error(i18n("Invalid entry to parse: %1", entry));
     }
     }
 }
 }
 
 
@@ -237,13 +237,13 @@ bool Loader::load(const QUrl &url)
 
 
         else
         else
         {
         {
-            emit errorChanged(i18n("%1 is not a local file!", url.toDisplayString()));
+            emit error(i18n("%1 is not a local file!", url.toDisplayString()));
             return false;
             return false;
         }
         }
     }
     }
     else
     else
     {
     {
-        emit errorChanged(i18n("%1 is not a valid url!", url.toDisplayString()));
+        emit error(i18n("%1 is not a valid url!", url.toDisplayString()));
         return false;
         return false;
     }
     }
 
 
@@ -275,18 +275,18 @@ bool Loader::load(const QUrl &url)
                     return false;
                     return false;
                 }
                 }
 
 
-                emit errorChanged(reply->errorString() + reply->errorText(), true);
+                emit error(reply->errorString() + reply->errorText(), true);
                 return false;
                 return false;
             }
             }
             else
             else
                 fileContent = reply->data().value(QStringLiteral("content")).toString();
                 fileContent = reply->data().value(QStringLiteral("content")).toString();
         }
         }
         else
         else
-            emit errorChanged(i18n("Action not supported! Try running the application as root."), true);
+            emit error(i18n("Action not supported! Try running the application as root."), true);
     }
     }
     else
     else
     {
     {
-        emit errorChanged(i18n("File does not exist: %1" ,fileName));
+        emit error(i18n("File does not exist: %1" ,fileName));
         return false;
         return false;
     }
     }
 
 
@@ -336,7 +336,7 @@ bool Loader::load(const QUrl &url)
                 foreach (const auto &hwmon, m_hwmons)
                 foreach (const auto &hwmon, m_hwmons)
                     connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
                     connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
 
 
-                emit errorChanged(i18n("Unable to parse interval line: %1", line), true);
+                emit error(i18n("Unable to parse interval line: %1", line), true);
                 return false;
                 return false;
             }
             }
         }
         }
@@ -362,7 +362,7 @@ bool Loader::load(const QUrl &url)
                     }
                     }
                 }
                 }
                 else
                 else
-                    emit errorChanged(i18n("Invalid entry: %1", fctemp));
+                    emit error(i18n("Invalid entry: %1", fctemp));
             }
             }
         }
         }
         else if (line.startsWith(QStringLiteral("DEVNAME=")))
         else if (line.startsWith(QStringLiteral("DEVNAME=")))
@@ -386,7 +386,7 @@ bool Loader::load(const QUrl &url)
                         foreach (const auto &hwmon, m_hwmons)
                         foreach (const auto &hwmon, m_hwmons)
                             connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
                             connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
 
 
-                        emit errorChanged(i18n("Can not parse %1", devname), true);
+                        emit error(i18n("Can not parse %1", devname), true);
                         return false;
                         return false;
                     }
                     }
 
 
@@ -396,7 +396,7 @@ bool Loader::load(const QUrl &url)
                         foreach (const auto &hwmon, m_hwmons)
                         foreach (const auto &hwmon, m_hwmons)
                             connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
                             connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
 
 
-                        emit errorChanged(i18n("Invalid config file!"), true);
+                        emit error(i18n("Invalid config file!"), true);
                         return false;
                         return false;
                     }
                     }
                 }
                 }
@@ -439,7 +439,7 @@ bool Loader::load(const QUrl &url)
             foreach (const auto &hwmon, m_hwmons)
             foreach (const auto &hwmon, m_hwmons)
                 connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
                 connect(hwmon, &Hwmon::configUpdateNeeded, this, &Loader::createConfigFile);
 
 
-            emit errorChanged(i18n("Unrecognized line in config: %1", line), true);
+            emit error(i18n("Unrecognized line in config: %1", line), true);
             return false;
             return false;
         }
         }
     }
     }
@@ -472,7 +472,7 @@ bool Loader::save(const QUrl &url)
 
 
     else
     else
     {
     {
-        emit errorChanged(i18n("%1 is not a local file!", url.toDisplayString()), true);
+        emit error(i18n("%1 is not a local file!", url.toDisplayString()), true);
         return false;
         return false;
     }
     }
 
 
@@ -505,12 +505,12 @@ bool Loader::save(const QUrl &url)
                     return false;
                     return false;
                 }
                 }
 
 
-                emit errorChanged(reply->errorString() + reply->errorText(), true);
+                emit error(reply->errorString() + reply->errorText(), true);
                 return false;
                 return false;
             }
             }
         }
         }
         else
         else
-            emit errorChanged(i18n("Action not supported! Try running the application as root."), true);
+            emit error(i18n("Action not supported! Try running the application as root."), true);
     }
     }
 
 
     return true;
     return true;
@@ -699,7 +699,7 @@ void Loader::handleDetectSensorsResult(int exitCode)
     if (exitCode)
     if (exitCode)
     {
     {
         if (process)
         if (process)
-            emit errorChanged(process->readAllStandardOutput());
+            emit error(process->readAllStandardOutput());
 
 
         auto action = newFancontrolAction();
         auto action = newFancontrolAction();
 
 
@@ -715,7 +715,7 @@ void Loader::handleDetectSensorsResult(int exitCode)
             job->start();
             job->start();
         }
         }
         else
         else
-            emit errorChanged(i18n("Action not supported! Try running the application as root."), true);
+            emit error(i18n("Action not supported! Try running the application as root."), true);
     }
     }
     else
     else
     {
     {
@@ -742,7 +742,7 @@ void Loader::handleDetectSensorsResult(KJob *job)
             return;
             return;
         }
         }
 
 
-        emit errorChanged(job->errorString() + job->errorText(), true);
+        emit error(job->errorString() + job->errorText(), true);
     }
     }
     else
     else
     {
     {
@@ -765,11 +765,6 @@ QList<QObject *> Loader::hwmonsAsObjects() const
     return list;
     return list;
 }
 }
 
 
-void Loader::setError (const QString &error, bool critical)
-{
-    emit errorChanged(error, critical);
-}
-
 void Loader::handleTestStatusChanged()
 void Loader::handleTestStatusChanged()
 {
 {
     auto testing = false;
     auto testing = false;

+ 1 - 5
import/src/loader.h

@@ -47,7 +47,6 @@ class Loader : public QObject
     Q_PROPERTY(QString configFile READ configFile NOTIFY configFileChanged)
     Q_PROPERTY(QString configFile READ configFile NOTIFY configFileChanged)
     Q_PROPERTY(QList<QObject *> hwmons READ hwmonsAsObjects NOTIFY hwmonsChanged)
     Q_PROPERTY(QList<QObject *> hwmons READ hwmonsAsObjects NOTIFY hwmonsChanged)
     Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
     Q_PROPERTY(int interval READ interval WRITE setInterval NOTIFY intervalChanged)
-    Q_PROPERTY(QString error READ error NOTIFY errorChanged)
     Q_PROPERTY(bool sensorsDetected READ sensorsDetected NOTIFY sensorsDetectedChanged)
     Q_PROPERTY(bool sensorsDetected READ sensorsDetected NOTIFY sensorsDetectedChanged)
     Q_PROPERTY(bool restartServiceAfterTesting READ restartServiceAfterTesting WRITE setRestartServiceAfterTesting NOTIFY restartServiceAfterTestingChanged)
     Q_PROPERTY(bool restartServiceAfterTesting READ restartServiceAfterTesting WRITE setRestartServiceAfterTesting NOTIFY restartServiceAfterTestingChanged)
 
 
@@ -71,7 +70,6 @@ public:
     QList<QObject *> hwmonsAsObjects() const;
     QList<QObject *> hwmonsAsObjects() const;
     int interval() const { return m_interval; }
     int interval() const { return m_interval; }
     void setInterval(int interval, bool writeNewConfig = true);
     void setInterval(int interval, bool writeNewConfig = true);
-    QString error() const { return m_error; }
 
 
 
 
 public slots:
 public slots:
@@ -80,7 +78,6 @@ public slots:
     void createConfigFile();
     void createConfigFile();
     void emitAllPwmFansChanged() { emit allPwmFansChanged(); }
     void emitAllPwmFansChanged() { emit allPwmFansChanged(); }
     void emitAllTempsChanged() { emit allTempsChanged(); }
     void emitAllTempsChanged() { emit allTempsChanged(); }
-    void setError(const QString &error, bool critical = false);
     void handleDetectSensorsResult(KJob *job);
     void handleDetectSensorsResult(KJob *job);
     void handleDetectSensorsResult(int exitCode);
     void handleDetectSensorsResult(int exitCode);
     void handleTestStatusChanged();    
     void handleTestStatusChanged();    
@@ -98,7 +95,6 @@ private:
     QList<Hwmon *> m_hwmons;
     QList<Hwmon *> m_hwmons;
     QUrl m_configUrl;
     QUrl m_configUrl;
     QString m_configFile;
     QString m_configFile;
-    QString m_error;
     QTimer *m_timer;
     QTimer *m_timer;
     bool m_sensorsDetected;
     bool m_sensorsDetected;
 
 
@@ -109,7 +105,7 @@ signals:
     void configFileChanged();
     void configFileChanged();
     void hwmonsChanged();
     void hwmonsChanged();
     void intervalChanged();
     void intervalChanged();
-    void errorChanged(QString, bool = false);
+    void error(QString, bool = false);
     void sensorsUpdateNeeded();
     void sensorsUpdateNeeded();
     void allPwmFansChanged();
     void allPwmFansChanged();
     void allTempsChanged();
     void allTempsChanged();

+ 10 - 10
import/src/pwmfan.cpp

@@ -84,7 +84,7 @@ PwmFan::PwmFan(Hwmon *parent, uint index) : Fan(parent, index),
         else
         else
         {
         {
             delete pwmFile;
             delete pwmFile;
-            emit errorChanged("Can't open pwmFile: " + pwmFile->fileName());
+            emit error("Can't open pwmFile: " + pwmFile->fileName());
         }
         }
 
 
         const auto pwmModeFile = new QFile(parent->path() + "/pwm" + QString::number(index) + "_mode", this);
         const auto pwmModeFile = new QFile(parent->path() + "/pwm" + QString::number(index) + "_mode", this);
@@ -102,7 +102,7 @@ PwmFan::PwmFan(Hwmon *parent, uint index) : Fan(parent, index),
         else
         else
         {
         {
             delete pwmModeFile;
             delete pwmModeFile;
-            emit errorChanged("Can't open pwmModeFile: " + pwmModeFile->fileName());
+            emit error("Can't open pwmModeFile: " + pwmModeFile->fileName());
         }
         }
     }
     }
 }
 }
@@ -152,7 +152,7 @@ void PwmFan::reset()
     else
     else
     {
     {
         delete pwmFile;
         delete pwmFile;
-        emit errorChanged("Can't open pwmFile: " + pwmFile->fileName());
+        emit error("Can't open pwmFile: " + pwmFile->fileName());
     }
     }
 
 
     const auto pwmModeFile = new QFile(m_parent->path() + "/pwm" + QString::number(m_index) + "_mode", this);
     const auto pwmModeFile = new QFile(m_parent->path() + "/pwm" + QString::number(m_index) + "_mode", this);
@@ -170,7 +170,7 @@ void PwmFan::reset()
     else
     else
     {
     {
         delete pwmModeFile;
         delete pwmModeFile;
-        emit errorChanged("Can't open pwmModeFile: " + pwmModeFile->fileName());
+        emit error("Can't open pwmModeFile: " + pwmModeFile->fileName());
     }
     }
 }
 }
 
 
@@ -209,12 +209,12 @@ bool PwmFan::setPwm(int pwm, bool write)
                             QTimer::singleShot(50, this, [this] (){ setPwmMode(m_pwmMode); });
                             QTimer::singleShot(50, this, [this] (){ setPwmMode(m_pwmMode); });
                         }
                         }
 
 
-                        emit errorChanged(i18n("Could not set pwm: ") + job->errorText());
+                        emit error(i18n("Could not set pwm: ") + job->errorText());
                     }
                     }
                     update();
                     update();
                 }
                 }
                 else
                 else
-                    emit errorChanged(i18n("Action not supported! Try running the application as root."), true);
+                    emit error(i18n("Action not supported! Try running the application as root."), true);
             }
             }
         }
         }
     }
     }
@@ -255,12 +255,12 @@ bool PwmFan::setPwmMode(int pwmMode, bool write)
                             QTimer::singleShot(50, this, [this] (){ setPwmMode(m_pwmMode); });
                             QTimer::singleShot(50, this, [this] (){ setPwmMode(m_pwmMode); });
                         }
                         }
 
 
-                        emit errorChanged(i18n("Could not set pwm mode: ") + job->errorText());
+                        emit error(i18n("Could not set pwm mode: ") + job->errorText());
                     }
                     }
                     update();
                     update();
                 }
                 }
                 else
                 else
-                    emit errorChanged(i18n("Action not supported! Try running the application as root."), true);
+                    emit error(i18n("Action not supported! Try running the application as root."), true);
             }
             }
         }
         }
     }
     }
@@ -279,7 +279,7 @@ void PwmFan::test()
 
 
             if (!job->exec())
             if (!job->exec())
             {
             {
-                emit errorChanged(i18n("Authorization error: ") + job->errorText());
+                emit error(i18n("Authorization error: ") + job->errorText());
                 m_testStatus = Error;
                 m_testStatus = Error;
                 emit testStatusChanged();
                 emit testStatusChanged();
                 return;
                 return;
@@ -287,7 +287,7 @@ void PwmFan::test()
         }
         }
         else
         else
         {
         {
-            emit errorChanged(i18n("Action not supported! Try running the application as root."), true);
+            emit error(i18n("Action not supported! Try running the application as root."), true);
             return;
             return;
         }
         }
     }
     }

+ 1 - 1
import/src/sensor.cpp

@@ -31,7 +31,7 @@ Sensor::Sensor(Hwmon *parent, uint index, const QString &path) : QObject(parent)
     m_index(index),
     m_index(index),
     m_path(path)
     m_path(path)
 {
 {
-    connect(this, &Sensor::errorChanged, parent, &Hwmon::setError);
+    connect(this, &Sensor::error, parent, &Hwmon::error);
 }
 }
 
 
 }
 }

+ 1 - 1
import/src/sensor.h

@@ -61,7 +61,7 @@ public slots:
 signals:
 signals:
 
 
     void nameChanged();
     void nameChanged();
-    void errorChanged(QString, bool = false);
+    void error(QString, bool = false);
 
 
 
 
 protected:
 protected:

+ 8 - 8
import/src/systemdcommunicator.cpp

@@ -76,7 +76,7 @@ SystemdCommunicator::SystemdCommunicator(GUIBase *parent, const QString &service
     m_serviceInterface(Q_NULLPTR)
     m_serviceInterface(Q_NULLPTR)
 {
 {
     if (parent)
     if (parent)
-        connect(this, &SystemdCommunicator::errorChanged, parent, &GUIBase::setError);
+        connect(this, &SystemdCommunicator::error, parent, &GUIBase::handleError);
 
 
     if (serviceName.isEmpty())
     if (serviceName.isEmpty())
         setServiceName(QStringLiteral(STANDARD_SERVICE_NAME));
         setServiceName(QStringLiteral(STANDARD_SERVICE_NAME));
@@ -113,7 +113,7 @@ void SystemdCommunicator::setServiceName(const QString &name)
             const auto dbusreply = m_managerInterface->callWithArgumentList(QDBus::AutoDetect, QStringLiteral("LoadUnit"), arguments);
             const auto dbusreply = m_managerInterface->callWithArgumentList(QDBus::AutoDetect, QStringLiteral("LoadUnit"), arguments);
             if (dbusreply.type() == QDBusMessage::ErrorMessage)
             if (dbusreply.type() == QDBusMessage::ErrorMessage)
             {
             {
-                emit errorChanged(dbusreply.errorMessage());
+                emit error(dbusreply.errorMessage());
                 m_serviceObjectPath.clear();
                 m_serviceObjectPath.clear();
             }
             }
             else
             else
@@ -155,7 +155,7 @@ bool SystemdCommunicator::serviceExists()
 
 
     if (dbusreply.type() == QDBusMessage::ErrorMessage)
     if (dbusreply.type() == QDBusMessage::ErrorMessage)
     {
     {
-        emit errorChanged(dbusreply.errorMessage());
+        emit error(dbusreply.errorMessage());
         return false;
         return false;
     }
     }
     SystemdUnitFileList list = qdbus_cast<SystemdUnitFileList>(dbusreply.arguments().at(0));
     SystemdUnitFileList list = qdbus_cast<SystemdUnitFileList>(dbusreply.arguments().at(0));
@@ -166,7 +166,7 @@ bool SystemdCommunicator::serviceExists()
             return true;
             return true;
     }
     }
 
 
-    emit errorChanged(i18n("Service does not exist: %1", m_serviceName));
+    emit error(i18n("Service does not exist: %1", m_serviceName));
     return false;
     return false;
 }
 }
 
 
@@ -245,7 +245,7 @@ bool SystemdCommunicator::dbusAction(const QString &method, const QVariantList &
 {
 {
     if (!m_managerInterface->isValid())
     if (!m_managerInterface->isValid())
     {
     {
-        emit errorChanged(i18n("Invalid manager interface!"), true);
+        emit error(i18n("Invalid manager interface!"), true);
         return false;
         return false;
 
 
     }
     }
@@ -271,7 +271,7 @@ bool SystemdCommunicator::dbusAction(const QString &method, const QVariantList &
         return true;
         return true;
     }
     }
 
 
-    emit errorChanged(dbusreply.errorMessage());
+    emit error(dbusreply.errorMessage());
     return false;
     return false;
 
 
 }
 }
@@ -295,7 +295,7 @@ void SystemdCommunicator::handleDbusActionResult(KJob *job)
             }
             }
         }
         }
 
 
-        emit errorChanged(job->errorText());
+        emit error(job->errorText());
     }
     }
 }
 }
 
 
@@ -309,7 +309,7 @@ bool SystemdCommunicator::restartService()
         return dbusAction(QStringLiteral("ReloadOrRestartUnit"), args);
         return dbusAction(QStringLiteral("ReloadOrRestartUnit"), args);
     }
     }
 
 
-    emit errorChanged(i18n("Service does not exist: %1", m_serviceName));
+    emit error(i18n("Service does not exist: %1", m_serviceName));
     return false;
     return false;
 }
 }
 
 

+ 1 - 1
import/src/systemdcommunicator.h

@@ -58,7 +58,7 @@ signals:
     void serviceNameChanged();
     void serviceNameChanged();
     void serviceEnabledChanged();
     void serviceEnabledChanged();
     void serviceActiveChanged();
     void serviceActiveChanged();
-    void errorChanged(QString, bool = false);
+    void error(QString, bool = false);
 
 
 
 
 protected slots:
 protected slots:

+ 5 - 5
import/src/temp.cpp

@@ -54,7 +54,7 @@ Temp::Temp(Hwmon *parent, uint index) :
         else
         else
         {
         {
             delete valueFile;
             delete valueFile;
-            emit errorChanged("Can't open valueFile " + parent->path() + "/temp" + QString::number(index) + "_input");
+            emit error("Can't open valueFile " + parent->path() + "/temp" + QString::number(index) + "_input");
         }
         }
 
 
         if (labelFile->exists())
         if (labelFile->exists())
@@ -62,10 +62,10 @@ Temp::Temp(Hwmon *parent, uint index) :
             if (labelFile->open(QFile::ReadOnly))
             if (labelFile->open(QFile::ReadOnly))
                 m_label = QTextStream(labelFile).readLine();
                 m_label = QTextStream(labelFile).readLine();
             else
             else
-                emit errorChanged("Can't open labelFile: " + parent->path() + "/temp" + QString::number(index) + "_label");
+                emit error("Can't open labelFile: " + parent->path() + "/temp" + QString::number(index) + "_label");
         }
         }
         else
         else
-            emit errorChanged(parent->path() + "/temp" + QString::number(index) + "has no label.");
+            emit error(parent->path() + "/temp" + QString::number(index) + "has no label.");
 
 
         delete labelFile;
         delete labelFile;
     }
     }
@@ -122,7 +122,7 @@ void Temp::reset()
             m_value /= 1000;
             m_value /= 1000;
         }
         }
         else
         else
-            emit errorChanged("Can't open valueFile " + m_parent->path() + "/temp" + QString::number(m_index) + "_input");
+            emit error("Can't open valueFile " + m_parent->path() + "/temp" + QString::number(m_index) + "_input");
     }
     }
 }
 }
 
 
@@ -134,7 +134,7 @@ void Temp::update()
     const auto value = m_valueStream->readAll().toInt(&success) / 1000;
     const auto value = m_valueStream->readAll().toInt(&success) / 1000;
 
 
     if (!success)
     if (!success)
-        emit errorChanged("Can't update value of temp:" + m_parent->path() + "/temp" + QString::number(m_index));
+        emit error("Can't update value of temp:" + m_parent->path() + "/temp" + QString::number(m_index));
     
     
     if (value != m_value)
     if (value != m_value)
     {
     {