-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: save settings on exit #125
Conversation
Looks good to me, but this is my idea in the first place, so I'll let @LeonMatthesKDAB review ;-) Debugging indicated that with offscreen QPA the Settings timer had time to fire but without it, the app would exit due to lastWindowClosed(), without waiting for scriptFinished and without saving settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall making sure we save the settings when the timer is still active definitely makes sense.
However, can you try calling saveOnExit() in the Settings destructor, instead of connecting it to scriptFinished?
It just seems like that would be the more fool-proof option and should cover more cases.
Hm, I just tried testing knut locally and this PR actually doesn't seem to fix the issue 🤔 Edit: I've got the output from the failing tests. mfc-utils was using qdebug instead of qwarning. |
So for the mfc_convert_dialog test I get the following files: expected
actual
So is this change correct? |
Hm, so for me the tests only pass with these patches: Are these updates expected? I'm not too familiar with mfc-utils, so can't tell if they are sensible. |
Don't forget the additional variable of running tests via ctest/CI versus running tests directly (QtCreator or command-line). So yes, if you stay within the ctest/CI use case, this patch isn't needed. But better save in all cases to minimize surprises. Calling saveOnExit() in the Settings destructor is an interesting idea, I'll let @smnppKDAB test it. |
Here is the corresponding MR : https://codereview.kdab.com/c/kdab/mfc-utils/+/144526 |
343b1d8
to
9e8c55a
Compare
Oh, right, I didn't know about that MR. Please link any MRs that a PR is related to next time :) |
9e8c55a
to
a1a859f
Compare
We add a way to save settings before exiting if there are changes. This make the tests to pass with the corrected knut.json
ace2022
to
9bff7ba
Compare
f2bf022
to
9bff7ba
Compare
We add a way to save settings before exiting if there are changes. This make the tests to pass with the corrected knut.json