Bug 389331

Summary: Changes to shortcuts only reflected after restart in some situations
Product: [Applications] gwenview Reporter: null <null>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: devel, nate
Priority: NOR    
Version: 17.12.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 18.04.0

Description null 2018-01-22 22:39:12 UTC
After restoring the default shortcut for Quit and switching to View mode, the old shortcut still works.

Detailed STR:
- Start Gwenview (Start Page should show).
- Open shortcut config dialog, set ⎋ as shortcut for Quit, Reassign → OK.
- ⎋ to close Gwenview.
- Restart Gwenview, open shortcut config dialog again, reset shortcuts: Defaults → OK.
- Switch modes (e.g. either from Start Page to Browse, or from Browse to View etc), press ⎋.
- ER: Default action, e.g. mode switch or no action.
- AR: Gwenview closes. (After an additional restart this does not occur anymore, though).

This seems to occur only if view mode was never active.

There's also a similar issue, when setting ⎋ for Quit and then switching to View mode: The shortcut is not working (no Quit, no Browse mode).

Very strange - maybe a bug inside KActionCollection or in Gwenview's handling of it?

(Copied from various comments in https://phabricator.kde.org/D9943)
Comment 1 Peter Mühlenpfordt 2018-04-04 11:09:44 UTC
I can't reproduce this any more in any other branch than Applications/17.12. Tested in master, Applications/18.04 and even Applications/17.08 is ok.
Comment 2 null 2018-04-04 19:34:55 UTC
The problem is still happening for me in master with KF 5.44.

Try with a fresh config?

(On the other hand, the steps to reproduce are quite complicated. I doubt many users will run into this problem, so it's probably not a high-priority bug.)
Comment 3 Peter Mühlenpfordt 2018-04-09 07:47:11 UTC
Git commit 936e30aca40e898db2719ee74b40fcffef740136 by Peter Mühlenpfordt.
Committed on 09/04/2018 at 07:41.
Pushed by muhlenpfordt into branch 'Applications/18.04'.

Fix shortcut config changes sometimes not updating until restart

Summary:
After setting or resetting custom shortcuts for actions in Browse or
Start Page Mode and then switching to View Mode these changes are not
active until next Gwenview restart.
This patch adds a `refreshActionProperties()` call after the shortcut
config dialog is closed to fix this.
FIXED-IN: 18.04.0

Test Plan:
* Start Gwenview in Browse Mode or Start Page Mode
* {nav Settings > Configure Shortcuts...}
* Set custom shortcut for {nav Quit} to e.g. {key Esc}
* Switch to View Mode displaying any image
* {key Esc} should quit Gwenview
* Restart Gwenview in Browse Mode or Start Page Mode
* {nav Settings > Configure Shortcuts...}
* Reset shortcuts with {nav Defaults}
* Switch to View Mode displaying any image
* {key Ctrl Q} should quit Gwenview

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx, huoni

Differential Revision: https://phabricator.kde.org/D12023

M  +8    -2    app/mainwindow.cpp
M  +1    -0    app/mainwindow.h

https://commits.kde.org/gwenview/936e30aca40e898db2719ee74b40fcffef740136