if ((cit->kind() == MenuItem::Command
|| cit->kind() == MenuItem::Submenu
|| cit->kind() == MenuItem::Help)
- && (!i.optional() || cit->status().enabled())) {
+ && cit->status().enabled()) {
enabled = true;
break;
}
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),