#4316 Fix regression issue with export completion and import menus showing up everywhere

This commit is contained in:
Gaute Lindkvist committed 2019-04-12 13:15:51 +02:00
1 parent 54a096a660
commit 34fd604bd8
1 file changed
+2 -2
@@ -835,7 +835,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
// Work in progress -- End
appendCreateCompletions(menuBuilder, menuBuilder.itemCount() > 0u);
appendImportMenu(menuBuilder, menuBuilder.itemCount() > 0u);
bool addedExportWellPaths = appendExportWellPaths(menuBuilder, menuBuilder.itemCount() > 0u) > 0;
appendExportCompletions(menuBuilder, menuBuilder.itemCount() > 0u && !addedExportWellPaths);
@@ -1127,7 +1126,8 @@ int RimContextCommandBuilder::appendSubMenuWithCommands(caf::CmdFeatureMenuBuild
}
else
{
if (!menuBuilder.isCmdFeatureAdded(candidate))
if (caf::CmdFeatureManager::instance()->getCommandFeature(candidate.toStdString())->canFeatureBeExecuted() &&
!menuBuilder.isCmdFeatureAdded(candidate))
{
validCommands << candidate;
actualCommandsAdded++;