Hide OptSubmenus (#9717) (for real this time)

Amend 6cc69343 and d449e7e6. See the latter for the rationale behind this
change.
This commit is contained in:
Guillaume Munch 2015-12-17 22:26:50 +00:00
parent 6cc6934378
commit 54a28ca2dc

View File

@ -419,7 +419,7 @@ void MenuDefinition::addWithStatusCheck(MenuItem const & i)
if ((cit->kind() == MenuItem::Command
|| cit->kind() == MenuItem::Submenu
|| cit->kind() == MenuItem::Help)
&& (!i.optional() || cit->status().enabled())) {
&& cit->status().enabled()) {
enabled = true;
break;
}
@ -1771,7 +1771,7 @@ void Menu::Impl::populate(QMenu & qMenu, MenuDefinition const & menu)
else if (m->kind() == MenuItem::Submenu) {
QMenu * subMenu = qMenu.addMenu(label(*m));
populate(*subMenu, m->submenu());
subMenu->setEnabled(m->status().enabled());
subMenu->setEnabled(!subMenu->isEmpty());
} else {
// we have a MenuItem::Command
qMenu.addAction(new Action(QIcon(), label(*m),