From 53b572f98791146e1755a7bbb5f22f2e521eea8f Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 1 Jan 2021 12:55:37 -0800 Subject: [PATCH] mobile: don't connect to applicationStateChanged signal early We don't want to connect to this until all parts of the QMLManager object are set up. Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 5986566cc..96fecff96 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -209,7 +209,6 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), m_instance = this; m_lastDevicePixelRatio = qApp->devicePixelRatio(); timer.start(); - connect(qobject_cast(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged); // make upload signals available in QML // Remark: signal - signal connect @@ -324,6 +323,9 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), connect(Command::getUndoStack(), &QUndoStack::undoTextChanged, this, &QMLManager::undoTextChanged); connect(Command::getUndoStack(), &QUndoStack::redoTextChanged, this, &QMLManager::redoTextChanged); + // now that everything is setup, connect the application changed signal + connect(qobject_cast(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged); + // we start out with clean data updateHaveLocalChanges(false); }