| 420 | } |
| 421 | |
| 422 | bool PackProfile::remove(const int index) |
| 423 | { |
| 424 | auto patch = getComponent(index); |
| 425 | if (!patch->isRemovable()) { |
| 426 | qCWarning(instanceProfileC) << d->m_instance->name() << "|" << "Patch" << patch->getID() << "is non-removable"; |
| 427 | return false; |
| 428 | } |
| 429 | |
| 430 | if (!removeComponent_internal(patch)) { |
| 431 | qCCritical(instanceProfileC) << d->m_instance->name() << "|" << "Patch" << patch->getID() << "could not be removed"; |
| 432 | return false; |
| 433 | } |
| 434 | |
| 435 | beginRemoveRows(QModelIndex(), index, index); |
| 436 | d->components.removeAt(index); |
| 437 | d->componentIndex.remove(patch->getID()); |
| 438 | endRemoveRows(); |
| 439 | invalidateLaunchProfile(); |
| 440 | scheduleSave(); |
| 441 | return true; |
| 442 | } |
| 443 | |
| 444 | bool PackProfile::remove(const QString& id) |
| 445 | { |
no test coverage detected