| 657 | } |
| 658 | |
| 659 | bool PackProfile::remove(const int index) |
| 660 | { |
| 661 | auto patch = getComponent(index); |
| 662 | if (!patch->isRemovable()) |
| 663 | { |
| 664 | qWarning() << "Patch" << patch->getID() << "is non-removable"; |
| 665 | return false; |
| 666 | } |
| 667 | |
| 668 | if(!removeComponent_internal(patch)) |
| 669 | { |
| 670 | qCritical() << "Patch" << patch->getID() << "could not be removed"; |
| 671 | return false; |
| 672 | } |
| 673 | |
| 674 | beginRemoveRows(QModelIndex(), index, index); |
| 675 | d->components.removeAt(index); |
| 676 | d->componentIndex.remove(patch->getID()); |
| 677 | endRemoveRows(); |
| 678 | invalidateLaunchProfile(); |
| 679 | scheduleSave(); |
| 680 | return true; |
| 681 | } |
| 682 | |
| 683 | bool PackProfile::remove(const QString id) |
| 684 | { |
no test coverage detected