From d9cc013813a2a360a9518ecfd3b2e0bb0596d86a Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 22 Sep 2020 21:21:45 +0200 Subject: Change modId() to nexusId(). --- src/modinfo.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index aed17d2a..bbeefb12 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -180,11 +180,11 @@ bool ModInfo::removeMod(unsigned int index) ModInfo::Ptr modInfo = s_Collection[index]; s_ModsByName.erase(s_ModsByName.find(modInfo->name())); - auto iter = s_ModsByModID.find(std::pair(modInfo->gameName(), modInfo->modId())); + auto iter = s_ModsByModID.find(std::pair(modInfo->gameName(), modInfo->nexusId())); if (iter != s_ModsByModID.end()) { std::vector indices = iter->second; indices.erase(std::remove(indices.begin(), indices.end(), index), indices.end()); - s_ModsByModID[std::pair(modInfo->gameName(), modInfo->modId())] = indices; + s_ModsByModID[std::pair(modInfo->gameName(), modInfo->nexusId())] = indices; } // physically remove the mod directory @@ -282,7 +282,7 @@ void ModInfo::updateIndices() for (unsigned int i = 0; i < s_Collection.size(); ++i) { QString modName = s_Collection[i]->internalName(); QString game = s_Collection[i]->gameName(); - int modID = s_Collection[i]->modId(); + int modID = s_Collection[i]->nexusId(); s_ModsByName[modName] = i; s_ModsByModID[std::pair(game, modID)].push_back(i); } @@ -334,7 +334,7 @@ bool ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *recei std::set> organizedGames; for (auto mod : s_Collection) { if (mod->canBeUpdated() && mod->getLastNexusUpdate() < QDateTime::currentDateTimeUtc().addMonths(-1)) { - organizedGames.insert(std::make_pair(mod->gameName().toLower(), mod->modId())); + organizedGames.insert(std::make_pair(mod->gameName().toLower(), mod->nexusId())); } } @@ -372,7 +372,7 @@ std::set> ModInfo::filteredMods(QString gameName, QVaria for (QVariant result : updateData) { QVariantMap update = result.toMap(); std::copy_if(s_Collection.begin(), s_Collection.end(), std::inserter(finalMods, finalMods.end()), [=](QSharedPointer info) -> bool { - if (info->modId() == update["mod_id"].toInt() && info->gameName().compare(gameName, Qt::CaseInsensitive) == 0) + if (info->nexusId() == update["mod_id"].toInt() && info->gameName().compare(gameName, Qt::CaseInsensitive) == 0) if (info->getLastNexusUpdate().addSecs(-3600) < QDateTime::fromSecsSinceEpoch(update["latest_file_update"].toInt(), Qt::UTC)) return true; return false; @@ -419,7 +419,7 @@ void ModInfo::manualUpdateCheck(PluginContainer *pluginContainer, QObject *recei } } mods.erase( - std::remove_if(mods.begin(), mods.end(), [](ModInfo::Ptr mod) -> bool { return mod->modId() <= 0; }), + std::remove_if(mods.begin(), mods.end(), [](ModInfo::Ptr mod) -> bool { return mod->nexusId() <= 0; }), mods.end() ); for (auto mod : mods) { @@ -434,7 +434,7 @@ void ModInfo::manualUpdateCheck(PluginContainer *pluginContainer, QObject *recei log::info("Checking updates for {} mods...", mods.size()); for (auto mod : mods) { - organizedGames.insert(std::make_pair(mod->gameName().toLower(), mod->modId())); + organizedGames.insert(std::make_pair(mod->gameName().toLower(), mod->nexusId())); } for (auto game : organizedGames) { -- cgit v1.3.1