* \brief Add the given Aspect to my list of children. */
| 519 | * \brief Add the given Aspect to my list of children. |
| 520 | */ |
| 521 | bool AbstractAspect::addChild(AbstractAspect* child) { |
| 522 | Q_CHECK_PTR(child); |
| 523 | |
| 524 | const QString new_name = uniqueNameFor(child->name()); |
| 525 | beginMacro(i18n("%1: add %2", name(), new_name)); |
| 526 | if (new_name != child->name()) { |
| 527 | info(i18n(R"(Renaming "%1" to "%2" in order to avoid name collision.)", child->name(), new_name)); |
| 528 | child->setName(new_name); |
| 529 | } |
| 530 | |
| 531 | exec(new AspectChildAddCmd(d, child, d->m_children.count())); |
| 532 | endMacro(); |
| 533 | return true; |
| 534 | } |
| 535 | |
| 536 | /** |
| 537 | * \brief Add the given Aspect to my list of children without any checks and without putting this step onto the undo-stack |
no test coverage detected