From ff4fbbdc5fa5ada01bd5bc3d8f8004279d7cc6b8 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 24 May 2020 14:39:39 +0200 Subject: Switch from ThreadPool to a simpler thread map for containers. --- src/modinfo.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 81b45a49..eb0f0b4f 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -29,7 +29,7 @@ along with Mod Organizer. If not, see . #include "modinfodialog.h" #include "overwriteinfodialog.h" #include "versioninfo.h" -#include "envfs.h" +#include "thread_utils.h" #include #include @@ -46,7 +46,6 @@ using namespace MOBase; using namespace MOShared; -env::ThreadPool ModInfo::s_Threads; std::vector ModInfo::s_Collection; std::map ModInfo::s_ModsByName; std::map, std::vector> ModInfo::s_ModsByModID; @@ -289,13 +288,7 @@ void ModInfo::updateFromDisc(const QString &modDirectory, std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName); - // This force loading a part of the FileTree: - s_Threads.setMax(refreshThreadCount); - for (auto& p : s_Collection) { - auto& t = s_Threads.request(); - t.ptr = p; - t.wakeup(); - } + parallelMap(std::begin(s_Collection), std::end(s_Collection), &ModInfo::isValid, refreshThreadCount); updateIndices(); -- cgit v1.3.1