qgis/Quantum-GIS — pull request #164 by dakcarto (2012-06-10 16:45:54+00:00)
Title: Fix menus for 5754, 5753 and address feature request for 5516

Info is in the commit messages. Commit 10fe3872 should probably be reviewed by core developers, as it changes functionality of menus. No new strings added.

Commit f01c6ad8 only fixes the issue as far as QGIS src code is concerned. It doesn't keep plugins, that are added by user, from hijacking the About or Preferences... menu actions, under QGIS application menu on Mac. For example, CadTools and SEXTANTE hijack the About menu, if installed. The last plugin to load that has a QAction with a name that starts with 'about*' will be the winning hijacker. This is only if the plugin installs its own top-level menu in the menu bar; submenus are ignored by Qt for the Mac-only merge 'feature'.

To fix this last Mac-only issue, a function needs added that can be called whenever/wherever a plugin is added to a top-level menubar menu. It should check if any of the QActions added has a role of QAction::TextHeuristicRole and, if so, set it to QAction::NoRole, as all menu roles are already explicitly defined for AboutRole and PreferencesRole (in src/ui/qgisapp.ui). Any new QAction's menu role, excepting maybe in the future ApplicationSpecificRole, should not be allowed to heuristically hijack the QGIS.app's main application menu actions, just because their action's title starts with a particular text.

QAction::TextHeuristicRole is basically a bad idea and its functionality should be removed from Qt.