diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-24 13:36:16 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-24 13:36:16 +0200 |
| commit | 73248d9e4036ad6b9494f678efbc97e919ebfbcf (patch) | |
| tree | bd73df7a4f932623fe7691277f179240db4d44a9 /src/modinfo.cpp | |
| parent | a284c64dc109797514b4664d37e6b6dc3d5c36c7 (diff) | |
Use the refresh_thread_count setting for ModInfo::updateFromDisc.
Diffstat (limited to 'src/modinfo.cpp')
| -rw-r--r-- | src/modinfo.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 5a90d74b..81b45a49 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -46,7 +46,7 @@ using namespace MOBase; using namespace MOShared; -env::ThreadPool<ModInfo::ModThread> ModInfo::s_Threads(10); +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; @@ -251,6 +251,7 @@ void ModInfo::updateFromDisc(const QString &modDirectory, DirectoryEntry **directoryStructure, PluginContainer *pluginContainer, bool displayForeign, + std::size_t refreshThreadCount, MOBase::IPluginGame const *game) { TimeThis tt("ModInfo::updateFromDisc()"); @@ -287,14 +288,17 @@ void ModInfo::updateFromDisc(const QString &modDirectory, createFromOverwrite(pluginContainer, game, directoryStructure); std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName); - - updateIndices(); - + + // This force loading a part of the FileTree: + s_Threads.setMax(refreshThreadCount); for (auto& p : s_Collection) { - auto &t = s_Threads.request(); + auto& t = s_Threads.request(); t.ptr = p; t.wakeup(); } + + updateIndices(); + } |
