mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-20 18:27:16 +01:00
see #2562 "Crash when making an interface that has subinterfaces a
subinterface of another interfrace". If an interface has subinterfaces, it should not be allowed to become subinterface of another interface.
This commit is contained in:
parent
0237f694d9
commit
7e2cdbb030
@ -1,3 +1,10 @@
|
||||
2011-07-09 vadim <vadim@netcitadel.com>
|
||||
|
||||
* ObjectManipulator.cpp (addSubinterfaceSubmenu): see #2562 "Crash
|
||||
when making an interface that has subinterfaces a subinterface of
|
||||
another interfrace". If an interface has subinterfaces, it should
|
||||
not be allowed to become subinterface of another interface.
|
||||
|
||||
2011-07-08 vadim <vadim@netcitadel.com>
|
||||
|
||||
* ObjectManipulator_slots.cpp (makeSubinterface): see #2561 "Add
|
||||
|
||||
@ -896,21 +896,29 @@ void ObjectManipulator::addSubinterfaceSubmenu(
|
||||
const list<FWObject*> &top_level_interfaces)
|
||||
{
|
||||
QMenu *submenu = menu->addMenu( tr("Make subinterface of..."));
|
||||
|
||||
int submenu_items_counter = 0;
|
||||
list<FWObject*>::const_iterator it;
|
||||
for (it=top_level_interfaces.begin(); it!=top_level_interfaces.end(); ++it)
|
||||
{
|
||||
Interface *intf = Interface::cast(*it);
|
||||
|
||||
bool skip_selected_interface = false;
|
||||
bool skip_interface = false;
|
||||
foreach(FWObject *obj, getCurrentObjectTree()->getSelectedObjects())
|
||||
{
|
||||
if (obj == intf)
|
||||
{
|
||||
skip_selected_interface = true;
|
||||
skip_interface = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!intf->validateChild(obj))
|
||||
{
|
||||
skip_interface = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (skip_selected_interface) continue;
|
||||
if (skip_interface) continue;
|
||||
if (intf->isLoopback()) continue;
|
||||
|
||||
// can not add interfaces to a read-only parent interface
|
||||
@ -931,7 +939,11 @@ void ObjectManipulator::addSubinterfaceSubmenu(
|
||||
|
||||
connect( submenu, SIGNAL(triggered(QAction*)),
|
||||
this, SLOT(makeSubinterface(QAction*)));
|
||||
|
||||
submenu_items_counter++;
|
||||
}
|
||||
|
||||
submenu->setEnabled(submenu_items_counter != 0);
|
||||
}
|
||||
|
||||
bool ObjectManipulator::getDeleteMenuState(FWObject *obj)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user