diff options
Diffstat (limited to 'src/citra_qt/game_list.cpp')
-rw-r--r-- | src/citra_qt/game_list.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 49cb98e70..1910da3ac 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -120,19 +120,15 @@ void GameList::LoadInterfaceLayout() void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) { - const auto callback = [&](unsigned* num_entries_out, - const std::string& directory, - const std::string& virtual_name, - unsigned int recursion) -> bool { - + const auto callback = [this, recursion](unsigned* num_entries_out, + const std::string& directory, + const std::string& virtual_name) -> bool { std::string physical_name = directory + DIR_SEP + virtual_name; if (stop_processing) return false; // Breaks the callback loop. - if (recursion > 0 && FileUtil::IsDirectory(physical_name)) { - AddFstEntriesToGameList(physical_name, recursion - 1); - } else { + if (!FileUtil::IsDirectory(physical_name)) { std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name); if (!loader) return true; @@ -145,6 +141,8 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))), new GameListItemSize(FileUtil::GetSize(physical_name)), }); + } else if (recursion > 0) { + AddFstEntriesToGameList(physical_name, recursion - 1); } return true; |