summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-07-30 00:48:46 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2020-11-03 11:39:06 -0500
commitc4df6b8ec98feb34cc9b9785e6d4d0eac6b3f571 (patch)
treec874d57f52243362ab2e7114c3d409b6326729cc /src/modinfo.cpp
parentc699aeb6d862f2c0960de126538931e4f13368b7 (diff)
split nexus connection stuff into NexusConnectionUI so it can be reused in the instance creation dialog
removed the PluginContainer* parameter from NexusInterface::instance() - it's a singleton, so it only needs to be given once, not every time - it doesn't even matter because the first time instance() is called, it creates the singleton, but the plugin container is always null - and setPluginContainer() is called much later from OrganizerCore with the correct value added non functional nexus page to instance creation dialog
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index bbeefb12..04cb18ce 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -266,7 +266,7 @@ void ModInfo::updateFromDisc(const QString &modDirectory,
createFromOverwrite(pluginContainer, game, directoryStructure);
std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName);
-
+
parallelMap(std::begin(s_Collection), std::end(s_Collection), &ModInfo::prefetch, refreshThreadCount);
updateIndices();
@@ -295,7 +295,7 @@ ModInfo::ModInfo(PluginContainer *pluginContainer)
}
-bool ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *receiver)
+bool ModInfo::checkAllForUpdate(QObject *receiver)
{
bool updatesAvailable = true;
@@ -348,19 +348,19 @@ bool ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *recei
}
for (auto game : organizedGames)
- NexusInterface::instance(pluginContainer)->requestUpdates(game.second, receiver, QVariant(), game.first, QString());
+ NexusInterface::instance().requestUpdates(game.second, receiver, QVariant(), game.first, QString());
} else if (earliest < QDateTime::currentDateTimeUtc().addMonths(-1)) {
for (auto gameName : games)
- NexusInterface::instance(pluginContainer)->requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::MONTH, receiver, QVariant(true), QString());
+ NexusInterface::instance().requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::MONTH, receiver, QVariant(true), QString());
} else if (earliest < QDateTime::currentDateTimeUtc().addDays(-7)) {
for (auto gameName : games)
- NexusInterface::instance(pluginContainer)->requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::MONTH, receiver, QVariant(false), QString());
+ NexusInterface::instance().requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::MONTH, receiver, QVariant(false), QString());
} else if (earliest < QDateTime::currentDateTimeUtc().addDays(-1)) {
for (auto gameName : games)
- NexusInterface::instance(pluginContainer)->requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::WEEK, receiver, QVariant(false), QString());
+ NexusInterface::instance().requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::WEEK, receiver, QVariant(false), QString());
} else {
for (auto gameName : games)
- NexusInterface::instance(pluginContainer)->requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::DAY, receiver, QVariant(false), QString());
+ NexusInterface::instance().requestUpdateInfo(gameName, NexusInterface::UpdatePeriod::DAY, receiver, QVariant(false), QString());
}
return updatesAvailable;
@@ -400,7 +400,7 @@ std::set<QSharedPointer<ModInfo>> ModInfo::filteredMods(QString gameName, QVaria
return finalMods;
}
-void ModInfo::manualUpdateCheck(PluginContainer *pluginContainer, QObject *receiver, std::multimap<QString, int> IDs)
+void ModInfo::manualUpdateCheck(QObject *receiver, std::multimap<QString, int> IDs)
{
std::vector<QSharedPointer<ModInfo>> mods;
std::set<std::pair<QString, int>> organizedGames;
@@ -438,7 +438,7 @@ void ModInfo::manualUpdateCheck(PluginContainer *pluginContainer, QObject *recei
}
for (auto game : organizedGames) {
- NexusInterface::instance(pluginContainer)->requestUpdates(game.second, receiver, QVariant(), game.first, QString());
+ NexusInterface::instance().requestUpdates(game.second, receiver, QVariant(), game.first, QString());
}
} else {
log::info("None of the selected mods can be updated.");