Qt: multi thread trophy loading

This commit is contained in:
Megamouse 2019-07-27 16:30:34 +02:00
parent 221508fa07
commit 56a249fd5a
4 changed files with 47 additions and 87 deletions

View file

@ -449,11 +449,11 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
QSet<QString> serials;
QList<int> indices;
for (int i = 0; i < path_list.size(); ++i)
QList<size_t> indices;
for (size_t i = 0; i < path_list.size(); ++i)
indices.append(i);
QtConcurrent::blockingMap(indices, [&](int& i)
QtConcurrent::blockingMap(indices, [&](size_t& i)
{
const std::string dir = path_list[i];
@ -536,7 +536,6 @@ void game_list_frame::Refresh(const bool fromDrive, const bool scrollAfter)
{
LOG_FATAL(GENERAL, "Failed to update game list at %s\n%s thrown: %s", dir, typeid(e).name(), e.what());
return;
// Blame MSVC for double }}
}
});