X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/d30c9cf675ad7141d1c8e31d2e72315267d45cf2..f311fbc3e1436bf248c54225f0743cfa671c4bd7:/GroupBlock.cpp diff --git a/GroupBlock.cpp b/GroupBlock.cpp index 4ec7f6b..74ec197 100644 --- a/GroupBlock.cpp +++ b/GroupBlock.cpp @@ -40,9 +40,22 @@ void GroupBlock::setParent(AbstractBlock *_parent) { topGroup = false; } } +void GroupBlock::removeAllBlocks() { + foreach(AbstractBlock* block, blocks) { + if (block->isGroupBlock()) { + GroupBlock* group = AB_TO_GRP(block); + group->removeAllBlocks(); + } + removeBlock(block); + } +} void GroupBlock::removeBlock(AbstractBlock* block) { - blocks.removeAll(block); + /* CAUTION: no check is done if the block has connected interface + or not. Thus, they must be deleted elsewhere. + */ + blocks.removeAll(block); + delete block; } void GroupBlock::parametersValidation(QList *checkedBlocks, QList *blocksToConfigure) {