Review Request 120195: [OS X] make sure the appropriate menu items get put in the Application menu's About and Preferences items

René J.V. Bertin rjvbertin at gmail.com
Thu Sep 25 14:06:12 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120195/
-----------------------------------------------------------

(Updated Sept. 25, 2014, 4:06 p.m.)


Review request for KDE Software on Mac OS X, KDevelop and Qt KDE.


Changes
-------

Added qt-kde as the issue that lead to this RR is caused by a Qt "feature" that should really be under configurability control.


Repository: kdevplatform


Description
-------

This is a complement to https://git.reviewboard.kde.org/r/120149/

OS X has a so-called Application menu, sitting in the MenuBar between the Apple (?) menu and the File menu, that has items (actions) such as About and Preferences, which are meant to play the respective roles for the application.

Qt4 for Mac uses `QAction::text()` based heuristics to decide which items get `PreferencesRole`, `AboutRole` etc. roles and thus are put in the Application menu. This works fine for applications that create the standard menu actions via KStandardAction. Applications that do not adhere to that scheme, or that create menu actions with matching names *before* the standard actions will end up having the wrong actions in the Application menu. For KDevelop, this means that the About menu item will invoke `About KDevelop Platform` and the Preferences item `Configure selection` (normally in the Project menu). The former misinterpretation isn't a huge deal, but launching a project's configure/cmake procedure (without any kind of confirmation asked) when you think you'll be opening a settings panel is more than just annoying.

The patch is simple: set the "incriminated" actions' `menuRole` to `NoRole` when they are created, on OS X. This prevents them from being put in the Application menu even when the patches from the above RR are not installed (though in that latter case the Preferences menu will probably invoke another unintended action).


Diffs
-----

  shell/mainwindow_p.cpp b50c444 

Diff: https://git.reviewboard.kde.org/r/120195/diff/


Testing
-------

On OS X 10.6.8 with KDE/MacPorts 4.12.5 and kdelibs git/master with all MacPorts and my patches applied. Other platforms will not be affected by this patch.

I have not yet looked into how this plays out on Qt5/KF5. The patch presented here should have the same effect if menu roles function the same way as in Qt4. If Qt5 uses comparable heuristics and `KAction` made the transition to KF5, the other kdelibs patches should port over easily.


Thanks,

René J.V. Bertin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140925/f691e163/attachment.html>


More information about the KDevelop-devel mailing list