mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2856 Context menus. Fix logical error during menu build-up
This commit is contained in:
@@ -202,13 +202,18 @@ void CmdFeatureMenuBuilder::appendToMenu(QMenu* menu)
|
|||||||
|
|
||||||
CAF_ASSERT(act);
|
CAF_ASSERT(act);
|
||||||
|
|
||||||
|
bool duplicateAct = false;
|
||||||
for (QAction* existingAct : currentMenu->actions())
|
for (QAction* existingAct : currentMenu->actions())
|
||||||
{
|
{
|
||||||
// If action exist, continue to make sure the action is positioned at the first
|
// If action exist, continue to make sure the action is positioned at the first
|
||||||
// location of a command ID
|
// location of a command ID
|
||||||
if (existingAct == act)
|
if (existingAct == act)
|
||||||
continue;
|
{
|
||||||
|
duplicateAct = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (duplicateAct) continue;
|
||||||
|
|
||||||
currentMenu->addAction(const_cast<QAction*>(act));
|
currentMenu->addAction(const_cast<QAction*>(act));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user