Use error callback to log errors in QMLManager

Instead of manually logging errors after each potentially
error-producing function, use the error-callback. The error texts
are accumulated in the QMLManager object for further use.

The text is transported to the QMLManager object via a queued
connection. Thus, errors can be reported from other threads
without having to deal with manual locking.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-01-24 22:56:52 +01:00 committed by Jan Mulder
parent df81a39aa5
commit f8f14c5edb
2 changed files with 32 additions and 16 deletions

View file

@ -58,6 +58,8 @@ public:
};
static QMLManager *instance();
Q_INVOKABLE void registerError(const QString &error);
QString consumeError();
QString cloudUserName() const;
void setCloudUserName(const QString &cloudUserName);
@ -200,6 +202,7 @@ private:
QString m_ssrfGpsWebUserid;
QString m_startPageText;
QString m_logText;
QString m_lastError;
bool m_locationServiceEnabled;
bool m_locationServiceAvailable;
bool m_verboseEnabled;