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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-01-01 12:55:37 -08:00
parent 995100a540
commit 53b572f987

View file

@ -209,7 +209,6 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio();
timer.start();
connect(qobject_cast<QApplication *>(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 *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged);
// we start out with clean data
updateHaveLocalChanges(false);
}