summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-01-24 22:56:52 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-31 14:47:26 +0100
commitf8f14c5edb43aafcc1d4c689af4a91d7274a4b82 (patch)
tree9ee428d5018eb5e8ad9feb404b64105541ca38df /mobile-widgets/qmlmanager.h
parentdf81a39aa5d10fd12928a1bef7fdf31e0050e439 (diff)
downloadsubsurface-f8f14c5edb43aafcc1d4c689af4a91d7274a4b82.tar.gz
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>
Diffstat (limited to 'mobile-widgets/qmlmanager.h')
-rw-r--r--mobile-widgets/qmlmanager.h3
1 files changed, 3 insertions, 0 deletions
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;