From f8f14c5edb43aafcc1d4c689af4a91d7274a4b82 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 24 Jan 2018 22:56:52 +0100 Subject: 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 --- mobile-widgets/qmlmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mobile-widgets/qmlmanager.h') diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 6917a6818..c171eabaf 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -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; -- cgit v1.2.3-70-g09d2