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

Method moveOverwriteContentToExistingMod

src/modlistviewactions.cpp:1348–1387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1346}
1347
1348void ModListViewActions::moveOverwriteContentToExistingMod() const
1349{
1350 QStringList mods;
1351 auto indexesByPriority = m_core.currentProfile()->getAllIndexesByPriority();
1352 for (auto& iter : indexesByPriority) {
1353 if ((iter.second != UINT_MAX)) {
1354 ModInfo::Ptr modInfo = ModInfo::getByIndex(iter.second);
1355 if (!modInfo->isSeparator() && !modInfo->isForeign() && !modInfo->isOverwrite()) {
1356 mods << modInfo->name();
1357 }
1358 }
1359 }
1360
1361 ListDialog dialog(m_parent);
1362 dialog.setWindowTitle("Select a mod...");
1363 dialog.setChoices(mods);
1364
1365 if (dialog.exec() == QDialog::Accepted) {
1366 QString result = dialog.getChoice();
1367 if (!result.isEmpty()) {
1368
1369 QString modAbsolutePath;
1370
1371 for (const auto& mod : m_core.modList()->allModsByProfilePriority()) {
1372 if (result.compare(mod) == 0) {
1373 ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(mod));
1374 modAbsolutePath = modInfo->absolutePath();
1375 break;
1376 }
1377 }
1378
1379 if (modAbsolutePath.isNull()) {
1380 log::warn("Mod {} has not been found, for some reason", result);
1381 return;
1382 }
1383
1384 moveOverwriteContentsTo(modAbsolutePath);
1385 }
1386 }
1387}
1388
1389void ModListViewActions::clearOverwrite() const
1390{

Callers 1

addOverwriteActionsMethod · 0.80

Calls 13

currentProfileMethod · 0.80
setChoicesMethod · 0.80
getChoiceMethod · 0.80
compareMethod · 0.80
isSeparatorMethod · 0.45
isForeignMethod · 0.45
isOverwriteMethod · 0.45
nameMethod · 0.45
execMethod · 0.45
isEmptyMethod · 0.45
modListMethod · 0.45

Tested by

no test coverage detected