aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-03-12 10:55:26 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-03-12 15:18:13 +0200
commit7da214a8c4af92c2027ab70056b14c639a8ac110 (patch)
tree9f4bfb68a2528e9e00c07ec98a85de418d4247ff
parentcdba35530ba5f9fedc0c803a0dbfada70cb57d7d (diff)
downloadsubsurface-7da214a8c4af92c2027ab70056b14c639a8ac110.tar.gz
Mobile: pass QString as value to registerError()
registerError() may be called from a different thread context. Passing the message as a const-reference may lead to a dangling reference. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--mobile-widgets/qmlmanager.cpp2
-rw-r--r--mobile-widgets/qmlmanager.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 08882c324..9a8666a8c 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -89,7 +89,7 @@ extern "C" int gitProgressCB(const char *text)
return 0;
}
-void QMLManager::registerError(const QString &error)
+void QMLManager::registerError(QString error)
{
appendTextToLog(error);
if (!m_lastError.isEmpty())
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index cd2efdb35..2d5a58ac4 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -61,7 +61,7 @@ public:
};
static QMLManager *instance();
- Q_INVOKABLE void registerError(const QString &error);
+ Q_INVOKABLE void registerError(QString error);
QString consumeError();
QString cloudUserName() const;