Skip to content

Commit

Permalink
#2856 Context menus. Fix logical error during menu build-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjørn Erik Jensen committed May 7, 2018
1 parent 2aeafb5 commit d659b8e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Fwk/AppFwk/cafCommand/cafCmdFeatureMenuBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,18 @@ void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)

CAF_ASSERT(act);

bool duplicateAct = false;
for (QAction* existingAct : currentMenu->actions())
{
// If action exist, continue to make sure the action is positioned at the first
// location of a command ID
if (existingAct == act)
continue;
{
duplicateAct = true;
break;
}
}
if (duplicateAct) continue;

currentMenu->addAction(const_cast<QAction*>(act));
}
Expand Down

0 comments on commit d659b8e

Please sign in to comment.