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
Sun Oct 5 00:20:47 BST 2014

This is an automatically generated e-mail. To reply, visit:

(Updated Oct. 4, 2014, 11:20 p.m.)


This change has been marked as submitted.

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

Repository: kdevplatform


This is a complement to

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).


  shell/mainwindow_p.cpp b50c444 



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.


René J.V. Bertin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list