From 81036b0149eebc9033fd0cc089c1d9237c39cf14 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Wed, 9 Sep 2020 11:25:19 -0500 Subject: Fixes for bulk update check * Check game source for validity * Display name of source when no updates found --- src/mainwindow.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index dc8e6141..a4b87690 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5524,10 +5524,10 @@ void MainWindow::nxmUpdateInfoAvailable(QString gameName, QVariant userData, QVa } QVariantList resultList = resultData.toList(); - QFutureWatcher>> *watcher = new QFutureWatcher>>(); + QFutureWatcher>>> *watcher = new QFutureWatcher>>>(); QObject::connect(watcher, &QFutureWatcher>>::finished, this, &MainWindow::finishUpdateInfo); - QFuture>> future = QtConcurrent::run([=]() -> std::set> { - return ModInfo::filteredMods(gameNameReal, resultList, userData.toBool(), true); + QFuture>>> future = QtConcurrent::run([=]() -> std::pair>> { + return std::make_pair(gameNameReal, ModInfo::filteredMods(gameNameReal, resultList, userData.toBool(), true)); }); watcher->setFuture(future); if (m_ModListSortProxy != nullptr) @@ -5536,12 +5536,13 @@ void MainWindow::nxmUpdateInfoAvailable(QString gameName, QVariant userData, QVa void MainWindow::finishUpdateInfo() { - QFutureWatcher>> *watcher = static_cast>> *>(sender()); - - auto finalMods = watcher->result(); + QFutureWatcher>>> *watcher = static_cast>>> *>(sender()); + + QString game = watcher->result().first; + auto finalMods = watcher->result().second; if (finalMods.empty()) { - log::info("None of your mods appear to have had recent file updates."); + log::info("None of your {} mods appear to have had recent file updates.", game); } std::set> organizedGames; -- cgit v1.3.1