diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 906eb9445..a89b05c8b 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -278,5 +278,10 @@ Kirigami.ScrollablePage { manager.credentialStatus = oldStatus event.accepted = true; } + if (!startPageWrapper.visible) { + manager.quit() + // we shouldn't come back from there, but just in case + event.accepted = true + } } } diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 05490ab42..3c2f8d311 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1198,3 +1198,10 @@ void QMLManager::screenChanged(QScreen *screen) m_lastDevicePixelRatio = screen->devicePixelRatio(); emit sendScreenChanged(screen); } + +void QMLManager::quit() +{ + if (unsaved_changes()) + saveChangesCloud(false); + QApplication::quit(); +} diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index af81368f3..7d1fc4a6b 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -132,6 +132,7 @@ public slots: void screenChanged(QScreen *screen); qreal lastDevicePixelRatio(); void appendTextToLog(const QString &newText); + void quit(); private: QString m_cloudUserName;