1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2026-02-08 00:32:27 +00:00

Make sure settings are stored when the app is closed.

This commit is contained in:
Filippo Scognamiglio
2026-01-11 19:44:57 +01:00
parent 60784c47d9
commit 1c49b02763
3 changed files with 9 additions and 8 deletions

View File

@@ -148,6 +148,11 @@ QtObject {
fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling) fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
} }
function close() {
storeSettings()
storeCustomProfiles()
}
property Storage storage: Storage {} property Storage storage: Storage {}
function stringify(obj) { function stringify(obj) {
@@ -891,11 +896,6 @@ QtObject {
initializedSettings() initializedSettings()
} }
Component.onDestruction: {
storeSettings()
storeCustomProfiles()
// storage.dropSettings(); //DROPS THE SETTINGS!.. REMEMBER TO DISABLE ONCE ENABLED!!
}
// VARS /////////////////////////////////////////////////////////////////// // VARS ///////////////////////////////////////////////////////////////////
property Label _sampleLabel: Label { property Label _sampleLabel: Label {

View File

@@ -102,7 +102,7 @@ ApplicationWindow {
id: quitAction id: quitAction
text: qsTr("Quit") text: qsTr("Quit")
shortcut: "Ctrl+Shift+Q" shortcut: "Ctrl+Shift+Q"
onTriggered: Qt.quit() onTriggered: appSettings.close()
} }
Action { Action {
id: showsettingsAction id: showsettingsAction

View File

@@ -64,7 +64,8 @@ QtObject {
window.destroy() window.destroy()
if (windowsModel.count === 0) if (windowsModel.count === 0) {
Qt.quit() appSettings.close()
}
} }
} }