Skip to content

Conversation

@cpina
Copy link
Contributor

@cpina cpina commented Jan 11, 2021

In MainWindow::closeEvent() now it calls Settings::sync() to call
QSettings->sync(). Qt documentation
(https://doc.qt.io/qt-5/qsettings.html#sync) says:

"This function is called automatically from QSettings's destructor and
by the event loop at regular intervals, so you normally don't need to
call it yourself."

On my Linux machine QSettings was not syncing to the
~/.config/sqlitebrowser/sqlitebrowser.conf (e.g. if I was doing View ->
Window Layout -> Simplify Window Layout and then close quickly was not
saved). Other settings recently changed before exiting would have been
the same.

Note that Settings is fully static so this seems to be an easy fix.

In MainWindow::closeEvent() now it calls Settings::sync() to call
QSettings->sync(). Qt documentation
(https://doc.qt.io/qt-5/qsettings.html#sync) says:

"This function is called automatically from QSettings's destructor and
by the event loop at regular intervals, so you normally don't need to
call it yourself."

On my Linux machine QSettings was not syncing to the
~/.config/sqlitebrowser/sqlitebrowser.conf (e.g. if I was doing View ->
Window Layout -> Simplify Window Layout and then close quickly was not
saved). Other settings recently changed before exiting would have been
the same.

Note that Settings is fully static so this seems to be an easy fix.
@justinclift
Copy link
Member

Without reviewing the code, the concept itself seems like a good idea. 😄

@mgrojo mgrojo merged commit 88ca9fa into sqlitebrowser:master Jan 15, 2021
@mgrojo
Copy link
Member

mgrojo commented Jan 15, 2021

Thanks, Carles! I've merged it to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants