Skip to content
Commit b6a185b2 authored by rk flx's avatar rk flx
Browse files

Prevent occasional empty Save button when upgrading from earlier version

Summary:
63bc26c6 introduced a regression, where when upgrading from
Spectacle 17.12 with {nav Save As} used last to 18.04 the {nav Save}
button would show no text at all and clicking would be a no-op (the down
arrow menu still worked, though).

The reason is the removal of a `default` case, however the root problem
has been there before: `lastUsedSaveMode()` could pass invalid values.
This can be fixed by properly refactoring the latter method too and
trading meticulosity for compactness when converting from `int` to
`enum`, i.e. adding the `default` to the correct place. If Spectacle
used KConfigXT this would not have been a problem in the first place…

Test Plan:
- `rm ~/.config/spectaclerc`
- Start Spectacle 17.12, {nav Save As}, {nav Quit}
- Start Spectacle from master
{nav Save} button now correctly shows the default text instead of
nothing at all. Button state still remembered after restart.

Reviewers: #spectacle, ngraham

Reviewed By: #spectacle, ngraham

Subscribers: ngraham

Differential Revision: https://phabricator.kde.org/D10682
parent db2231ae
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