Commit f6515c1c authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

only save state on application termination

will not keep state when the application crash but avoids saving state on each
state change
parent 6ed5a8a5
......@@ -29,21 +29,29 @@ import QtMultimedia 5.4
import Qt.labs.settings 1.0
ApplicationWindow {
id: mainWindow
visible: true
minimumWidth: 1000
width: 1000
minimumHeight: 600
height: 600
x: persistentSettings.x
y: persistentSettings.y
width: persistentSettings.width
height: persistentSettings.height
title: 'Elisa'
id: mainWindow
Settings {
property alias x: mainWindow.x
property alias y: mainWindow.y
property alias width: mainWindow.width
property alias height: mainWindow.height
id: persistentSettings
property int x
property int y
property int width
property int height
property alias playListState: playListModelItem.persistentState
property var playListState
}
property string globalBrowseFlag: 'BrowseDirectChildren'
......@@ -91,6 +99,19 @@ ApplicationWindow {
onTriggered: Qt.quit()
}
Connections {
target: Qt.application
onAboutToQuit:
{
persistentSettings.x = mainWindow.x;
persistentSettings.y = mainWindow.y;
persistentSettings.width = mainWindow.width;
persistentSettings.height = mainWindow.height;
persistentSettings.playListState = playListModelItem.persistentState;
}
}
Mpris2 {
id: mpris2Interface
......@@ -138,6 +159,8 @@ ApplicationWindow {
databaseInterface: localAlbumDatabase
persistentState: persistentSettings.playListState
onTrackHasBeenAdded: mainWindow.showPassiveNotification(i18n("Track %1 has been added", title), 1500, "", {})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment