mobile: fix broken undo stack initialization

We would dereference the undoAction before the command infrastructure
was initialized which led to a crash in the mobile app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-03-17 15:24:46 -07:00
parent 56068f51cb
commit ccda4f557c

View file

@ -207,13 +207,11 @@ QMLManager::QMLManager() :
m_initialized(false),
m_pluggedInDeviceName(""),
m_showNonDiveComputers(false),
undoAction(Command::undoAction(this)),
m_oldStatus(qPrefCloudStorage::CS_UNKNOWN)
{
m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio();
timer.start();
// make upload signals available in QML
// Remark: signal - signal connect
connect(uploadDiveLogsDE::instance(), &uploadDiveLogsDE::uploadFinish,
@ -334,6 +332,7 @@ QMLManager::QMLManager() :
// setup Command infrastructure
Command::init();
undoAction = Command::undoAction(this);
}
void QMLManager::applicationStateChanged(Qt::ApplicationState state)