Created attachment 1238549 [details] qgit-2.6-fix-custom-actions.patch Description of problem: Custom actions do not work in qgit 2.6 (they do nothing), a regression compared to earlier releases. This seems to be due to a behavior change in Qt 5 compared to Qt 4: QAction::text() now includes the automatically generated "&" for the keyboard shortcut. Therefore, it does not match the name of the action, and the action is not found. The attached patch solves this issue by removing the offending "&" sign. Version-Release number of selected component (if applicable): qgit-2.6-3.fc24 qgit-2.6-3.fc25 qgit-2.6-3.fc26 How reproducible: Always Steps to Reproduce: 1. Create a custom action in the dialog. 2. Try to run it. Actual results: Nothing happens. Expected results: The action is executed. Additional info: Patch attached.
qgit-2.6-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-98f2f3bf3a
qgit-2.6-4.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-2037955c6f
qgit-2.6-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-226d58d15e
qgit-2.6-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-98f2f3bf3a
qgit-2.6-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-226d58d15e
qgit-2.6-4.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2017-2037955c6f
qgit-2.6-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
qgit-2.6-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
qgit-2.6-4.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
Kevin, could you open a pull request at https://github.com/tibirna/qgit for this problem? Seems the fix haven't get in yet.
Well, I had some discussion with Cristian Tibirna, but he did not like my patch and it died out there. His first reply: > Please, help me understand what happens here. I don't think keyboard shortcuts > are added automatically. User has to explicitly put the "&" in the action > name. But then, the name is saved with the & in it. And as such. it should > match as is. > > What exactly happens here. > > (Of course, the patch is very simple. The only problem is that it would make > the removal of "&" happen even when the user actually wants to put an explicit > & in the action name -- e.g. "Commit & Push"). and then (the quoted quote is from me, the regular quote from him): > > No, I did not add any '&'. That is exactly why the action names do not > > match: the name is saved without any '&' (because there was none), but > > QAction decides to assign a keyboard shortcut and QAction::text() returns > > the text with the automatically assigned shortcut (i.e., with the '&' > > added). Qt 4 did not do that, but Qt 5 does. > > Since I can't reproduce this, I searched a bit and I fell on this: > http://stackoverflow.com/questions/32688153/how-to-disable-automatic-mnemonics-in-a-qt-application-on-kde > > So, it is not normal Qt behaviour, it is an additional KDE thing. > > In this context, I believe the right patch would be to attempt to remove the > ampersand *only* after having checked for the pristine text first. > > The best thing, given how CustomActions in QGit is intended to function would > be to either: > 1) store the original text and its associated QAction as a map, and never > check for the text in the QAction for the purposes of identifying the action > from the menu event only or > 2) disable the KDE plugin for the CustomActions menu specifically > > But I guess both would be more work. and I don't think anything has happened since.
OK, I'll keep your fix in the package until there is something better in upstream.
Looks to me that https://github.com/tibirna/qgit/commit/7b8f1ff9ce16bc2d8457362df2017bc0ffe65458 is the upstream fix for this issue, so I'm going to drop the downstream patch in the 2.8 update.