In krita3-testing_2+git20160422+r10-67~ubuntu16.04.1_amd64, after adding an alternative shortcut, krita fails to recognize the primary one -- it becomes empty, and remains that way. I cannot change or reset. Alternative ones works fine. Maybe the configuration for primary shortcuts is broken? Is this related to https://bugs.kde.org/show_bug.cgi?id=361325 ? Reproducible: Always
can confirm.
So i'm trying to fix this since yesterday, but all i can see is a mess with the action and shortcut dealing. We have a lot of duplicate code that does duplicate stuff and gets called multiple time to do (apparently the same?) thing. Namely KActionCollection writes the shortcut settings in kritashortcutsrc through writeSettings function when they are changed, though there it loops through the actions and it write both shortcuts (primary and alternate), with a format that is "actionName=primary; alternate". When Krita loads, readSettings gets called which internally calls loadCustomShortcuts of our KisActionRegistry class and here a first bell rang: we do have a writeCustomShortcuts function in KisActionRegistry but it's not used, moreover it writes the shortcut with a different format, namely only the custom shortcut is written. But then again even more confusion is added looking at ActionInfoItem, the struct used in writeCustomShortcuts and loadCustomShortcuts. Is defaultShortcut meant to be the primary shortcut or the actual defaultShortcut that is shown as a "default" option in the shortcut editor? And if the latter, since we only have one customShortcut key sequence, how can that deal with having a possible primary and alternate shortcut? And in the end, looking at KisShortcutsDialog_p.cpp, primarySequence and alternateSequence functions we see what the dialog (and probably the rest of the system) expexts, an action with TWO key sequences, but when we load the configs from our kritashortcutsrc we only load one, with the string "primary; alternate".
This patch should help iron out some of the bugs. Let me know if the lastest master helps. https://phabricator.kde.org/rKRITA520cbbfdfb662a46476a69aa0d24d30507a198c5 Stefano: You're right that the shortcuts configuration code is pretty bad. Unfortunately KisShortcutsDialog, KActionCollection and everything else in XMLGUI ultimately comes from upstream, so if something is confusing or looks poorly designed your guess is as good as mine as to the justification. The patch I wrote basically sticks to modifying KisActionRegistry, to keep the shortcut data in the same format as XMLGUI. I wr
Is the bug fixed now?
It seems fixed here. Resolving this for now. Tyson, if you still come across it, don't hesitate to reopen.
Yes, it's fixed. Thank you everyone!