kdevelop: prevent empty dockwidget context menuitems

Authored by rjvbb on Nov 22 2017, 9:00 PM.

Description

kdevelop: prevent empty dockwidget context menuitems

Summary:
This patch prevents dock widgets (toolviews) from having empty items in their context menus. Most the corresponding actions can probably not be represented in menus anyway and are thus unlikely to do anything when triggered through a menu. The average user doesn't know that though.

The patch achieves this by filtering out QActions that would not have a title in IdealDockWidget::contextMenuRequested() but also adds a menu item text to two actions which I think make sense to include in the context menu. (Doing this makes it possible to hide the toolview's toolbar in more situations, gaining a bit of vertical space.)

BUG: 386911
FIXED-IN: 5.2.1

Test Plan:
Works as intended on Mac and Linux/X11 .

I understand there may be another way to detect QActions that cannot be represented in menus but haven't yet found such an alternative. Such an alternative could be used in addition to the empty text check which I think should be done as argued in the summary.

Individual plugins can also override IToolViewFactor::contextMenuActions().

Reviewers: kfunk

Reviewed By: kfunk

Subscribers: kdevelop-devel

Tags: KDevelop

Differential Revision: https://phabricator.kde.org/D8954

Details

Committed
kfunkNov 22 2017, 9:01 PM
Reviewer
kfunk
Differential Revision
D8954: kdevelop: prevent empty dockwidget context menuitems
Parents
R32:e7d900981c04: appimage: Fixup dockerfile
Branches
Unknown
Tags
Unknown