summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jrim@rimpo.org>2020-09-09 13:34:54 -0500
committerGitHub <noreply@github.com>2020-09-09 13:34:54 -0500
commit3711cc01446fedca0aa7299d3bc98bdf38288862 (patch)
tree2816c977ecb2a4e992c69d250060753900b47383 /src/modinfo.cpp
parent504683776c51253fbd2b922a269b09177944d031 (diff)
parentd30d966500525cfe3137044c97db024230aac802 (diff)
Merge pull request #1230 from ModOrganizer2/bulk-update-fix
Fixes for bulk update check
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp
index 826aa5c9..b79ed657 100644
--- a/src/modinfo.cpp
+++ b/src/modinfo.cpp
@@ -312,6 +312,22 @@ bool ModInfo::checkAllForUpdate(PluginContainer *pluginContainer, QObject *recei
}
}
+ // Detect invalid source games
+ for (auto itr = games.begin(); itr != games.end(); ++itr) {
+ auto gamePlugins = pluginContainer->plugins<IPluginGame>();
+ IPluginGame* gamePlugin = qApp->property("managed_game").value<IPluginGame*>();
+ for (auto plugin : gamePlugins) {
+ if (plugin != nullptr && plugin->gameShortName().compare(*itr, Qt::CaseInsensitive) == 0) {
+ gamePlugin = plugin;
+ break;
+ }
+ }
+ if (gamePlugin != nullptr && gamePlugin->gameNexusName().isEmpty()) {
+ log::warn("{}", tr("The update check has found a mod with a Nexus ID and source game of %1, but this game is not a valid Nexus source.").arg(gamePlugin->gameName()));
+ itr = games.erase(itr);
+ }
+ }
+
if (latest < QDateTime::currentDateTimeUtc().addMonths(-1)) {
std::set<std::pair<QString, int>> organizedGames;
for (auto mod : s_Collection) {