MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / sendModsToFirstConflict

Method sendModsToFirstConflict

src/modlistviewactions.cpp:706–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704}
705
706void 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
729void ModListViewActions::sendModsToLastConflict(const QModelIndexList& indexes) const
730{

Callers 1

addSendToContextMenuMethod · 0.80

Calls 10

getModPriorityMethod · 0.80
currentProfileMethod · 0.80
changeModsPriorityMethod · 0.80
isValidMethod · 0.45
dataMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
modListMethod · 0.45

Tested by

no test coverage detected