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:
@@ -148,6 +148,11 @@ QtObject {
|
||||
fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
|
||||
}
|
||||
|
||||
function close() {
|
||||
storeSettings()
|
||||
storeCustomProfiles()
|
||||
}
|
||||
|
||||
property Storage storage: Storage {}
|
||||
|
||||
function stringify(obj) {
|
||||
@@ -891,11 +896,6 @@ QtObject {
|
||||
|
||||
initializedSettings()
|
||||
}
|
||||
Component.onDestruction: {
|
||||
storeSettings()
|
||||
storeCustomProfiles()
|
||||
// storage.dropSettings(); //DROPS THE SETTINGS!.. REMEMBER TO DISABLE ONCE ENABLED!!
|
||||
}
|
||||
|
||||
// VARS ///////////////////////////////////////////////////////////////////
|
||||
property Label _sampleLabel: Label {
|
||||
|
||||
@@ -102,7 +102,7 @@ ApplicationWindow {
|
||||
id: quitAction
|
||||
text: qsTr("Quit")
|
||||
shortcut: "Ctrl+Shift+Q"
|
||||
onTriggered: Qt.quit()
|
||||
onTriggered: appSettings.close()
|
||||
}
|
||||
Action {
|
||||
id: showsettingsAction
|
||||
|
||||
@@ -64,7 +64,8 @@ QtObject {
|
||||
|
||||
window.destroy()
|
||||
|
||||
if (windowsModel.count === 0)
|
||||
Qt.quit()
|
||||
if (windowsModel.count === 0) {
|
||||
appSettings.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user