| 538 | } |
| 539 | |
| 540 | void LauncherWindow::enableModClicked() |
| 541 | { |
| 542 | if (selectedModName == "") |
| 543 | return; |
| 544 | |
| 545 | for (const auto &matchingItem : |
| 546 | ui->enabledModsList->findItems(QString::fromStdString(selectedModName), Qt::MatchExactly)) |
| 547 | { |
| 548 | auto matchingName = matchingItem->text(); |
| 549 | // Already enabled |
| 550 | if (matchingName.toStdString() == selectedModName) |
| 551 | { |
| 552 | return; |
| 553 | } |
| 554 | } |
| 555 | |
| 556 | ui->enabledModsList->addItem(QString::fromStdString(selectedModName)); |
| 557 | |
| 558 | for (const auto &matchingItem : |
| 559 | ui->disabledModsList->findItems(QString::fromStdString(selectedModName), Qt::MatchExactly)) |
| 560 | { |
| 561 | delete matchingItem; |
| 562 | } |
| 563 | |
| 564 | this->rebuildModList(); |
| 565 | } |
| 566 | |
| 567 | void LauncherWindow::disableModClicked() |
| 568 | { |
nothing calls this directly
no test coverage detected