| 704 | } |
| 705 | |
| 706 | void ModListViewActions::sendModsToFirstConflict(const QModelIndexList& indexes) const |
| 707 | { |
| 708 | std::set<unsigned int> conflicts; |
| 709 | |
| 710 | for (auto& idx : indexes) { |
| 711 | if (!idx.data(ModList::IndexRole).isValid()) { |
| 712 | continue; |
| 713 | } |
| 714 | auto info = ModInfo::getByIndex(idx.data(ModList::IndexRole).toInt()); |
| 715 | conflicts.insert(info->getModOverwrite().begin(), info->getModOverwrite().end()); |
| 716 | } |
| 717 | |
| 718 | std::set<int> priorities; |
| 719 | std::transform(conflicts.begin(), conflicts.end(), |
| 720 | std::inserter(priorities, priorities.end()), [=](auto index) { |
| 721 | return m_core.currentProfile()->getModPriority(index); |
| 722 | }); |
| 723 | |
| 724 | if (!priorities.empty()) { |
| 725 | m_core.modList()->changeModsPriority(indexes, *priorities.begin()); |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | void ModListViewActions::sendModsToLastConflict(const QModelIndexList& indexes) const |
| 730 | { |
no test coverage detected