mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-23 23:13:39 -06:00
#2856 Context menus. Fix logical error during menu build-up
This commit is contained in:
parent
2aeafb509b
commit
d659b8e853
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user