From a284c64dc109797514b4664d37e6b6dc3d5c36c7 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 24 May 2020 13:28:00 +0200 Subject: Update file tree in parallel when loading from disk. --- src/modinfo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modinfo.cpp') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 0dd113c5..5a90d74b 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -29,6 +29,7 @@ along with Mod Organizer. If not, see . #include "modinfodialog.h" #include "overwriteinfodialog.h" #include "versioninfo.h" +#include "envfs.h" #include #include @@ -45,6 +46,7 @@ using namespace MOBase; using namespace MOShared; +env::ThreadPool ModInfo::s_Threads(10); std::vector ModInfo::s_Collection; std::map ModInfo::s_ModsByName; std::map, std::vector> ModInfo::s_ModsByModID; @@ -287,6 +289,12 @@ void ModInfo::updateFromDisc(const QString &modDirectory, std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName); updateIndices(); + + for (auto& p : s_Collection) { + auto &t = s_Threads.request(); + t.ptr = p; + t.wakeup(); + } } -- cgit v1.3.1