summaryrefslogtreecommitdiff
path: root/src/modinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modinfo.cpp')
-rw-r--r--src/modinfo.cpp11
1 files changed, 2 insertions, 9 deletions
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 <http://www.gnu.org/licenses/>.
#include "modinfodialog.h"
#include "overwriteinfodialog.h"
#include "versioninfo.h"
-#include "envfs.h"
+#include "thread_utils.h"
#include <iplugingame.h>
#include <versioninfo.h>
@@ -46,7 +46,6 @@ using namespace MOBase;
using namespace MOShared;
-env::ThreadPool<ModInfo::ModThread> ModInfo::s_Threads;
std::vector<ModInfo::Ptr> ModInfo::s_Collection;
std::map<QString, unsigned int> ModInfo::s_ModsByName;
std::map<std::pair<QString, int>, std::vector<unsigned int>> 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();