diff options
author | bunnei <bunneidev@gmail.com> | 2016-05-31 02:59:10 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2016-05-31 02:59:10 +0200 |
commit | 08e09184df753c9622df263e1731e1890afd3eb2 (patch) | |
tree | 7640df3c67947ff7ee9ef0d4003c33ac2fbf7c96 /src/citra_qt/game_list.cpp | |
parent | Merge pull request #1692 from Subv/rm_getpointer2 (diff) | |
parent | Common: Make recursive FileUtil functions take a maximum recursion (diff) | |
download | yuzu-08e09184df753c9622df263e1731e1890afd3eb2.tar yuzu-08e09184df753c9622df263e1731e1890afd3eb2.tar.gz yuzu-08e09184df753c9622df263e1731e1890afd3eb2.tar.bz2 yuzu-08e09184df753c9622df263e1731e1890afd3eb2.tar.lz yuzu-08e09184df753c9622df263e1731e1890afd3eb2.tar.xz yuzu-08e09184df753c9622df263e1731e1890afd3eb2.tar.zst yuzu-08e09184df753c9622df263e1731e1890afd3eb2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra_qt/game_list.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 570647539..49cb98e70 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -118,19 +118,20 @@ void GameList::LoadInterfaceLayout() item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder()); } -void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool deep_scan) +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) -> bool { + const std::string& virtual_name, + unsigned int recursion) -> bool { std::string physical_name = directory + DIR_SEP + virtual_name; if (stop_processing) return false; // Breaks the callback loop. - if (deep_scan && FileUtil::IsDirectory(physical_name)) { - AddFstEntriesToGameList(physical_name, true); + if (recursion > 0 && FileUtil::IsDirectory(physical_name)) { + AddFstEntriesToGameList(physical_name, recursion - 1); } else { std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name); if (!loader) @@ -155,7 +156,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool d void GameListWorker::run() { stop_processing = false; - AddFstEntriesToGameList(dir_path.toStdString(), deep_scan); + AddFstEntriesToGameList(dir_path.toStdString(), deep_scan ? 256 : 0); emit Finished(); } |