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

Method updateModsInDirectoryStructure

src/organizercore.cpp:1393–1434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1391}
1392
1393void OrganizerCore::updateModsInDirectoryStructure(
1394 QMap<unsigned int, ModInfo::Ptr> modInfo)
1395{
1396 std::vector<DirectoryRefresher::EntryInfo> entries;
1397
1398 for (auto idx : modInfo.keys()) {
1399 entries.push_back({modInfo[idx]->name(),
1400 modInfo[idx]->absolutePath(),
1401 modInfo[idx]->stealFiles(),
1402 {},
1403 m_CurrentProfile->getModPriority(idx)});
1404 }
1405
1406 m_DirectoryRefresher->addMultipleModsFilesToStructure(m_DirectoryStructure, entries);
1407
1408 DirectoryRefresher::cleanStructure(m_DirectoryStructure);
1409 // need to refresh plugin list now so we can activate esps
1410 refreshESPList(true);
1411 // activate all esps of the specified mod so the bsas get activated along with
1412 // it
1413 m_PluginList.blockSignals(true);
1414 updateModsActiveState(modInfo.keys(), true);
1415 m_PluginList.blockSignals(false);
1416 // now we need to refresh the bsa list and save it so there is no confusion
1417 // about what archives are available and active
1418 refreshBSAList();
1419 if (m_UserInterface != nullptr) {
1420 m_UserInterface->archivesWriter().writeImmediately(false);
1421 }
1422
1423 std::vector<QString> archives = enabledArchives();
1424 m_DirectoryRefresher->setMods(m_CurrentProfile->getActiveMods(),
1425 std::set<QString>(archives.begin(), archives.end()));
1426
1427 // finally also add files from bsas to the directory structure
1428 for (auto idx : modInfo.keys()) {
1429 m_DirectoryRefresher->addModBSAToStructure(
1430 m_DirectoryStructure, modInfo[idx]->name(),
1431 m_CurrentProfile->getModPriority(idx), modInfo[idx]->absolutePath(),
1432 modInfo[idx]->archives());
1433 }
1434}
1435
1436void OrganizerCore::loggedInAction(QWidget* parent, std::function<void()> f)
1437{

Callers

nothing calls this directly

Calls 12

keysMethod · 0.80
getModPriorityMethod · 0.80
getActiveModsMethod · 0.80
addModBSAToStructureMethod · 0.80
nameMethod · 0.45
absolutePathMethod · 0.45
stealFilesMethod · 0.45
setModsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
archivesMethod · 0.45

Tested by

no test coverage detected