| 446 | } |
| 447 | |
| 448 | bool PackProfile::remove(const int index) |
| 449 | { |
| 450 | auto patch = getComponent(index); |
| 451 | if (!patch->isRemovable()) |
| 452 | { |
| 453 | qWarning() << "Patch" << patch->getID() << "is non-removable"; |
| 454 | return false; |
| 455 | } |
| 456 | |
| 457 | if(!removeComponent_internal(patch)) |
| 458 | { |
| 459 | qCritical() << "Patch" << patch->getID() << "could not be removed"; |
| 460 | return false; |
| 461 | } |
| 462 | |
| 463 | beginRemoveRows(QModelIndex(), index, index); |
| 464 | d->components.removeAt(index); |
| 465 | d->componentIndex.remove(patch->getID()); |
| 466 | endRemoveRows(); |
| 467 | invalidateLaunchProfile(); |
| 468 | scheduleSave(); |
| 469 | return true; |
| 470 | } |
| 471 | |
| 472 | bool PackProfile::remove(const QString id) |
| 473 | { |
no test coverage detected