diff options
Diffstat (limited to 'src/citra_qt/game_list.cpp')
| -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 d4ac9c96e..adbcf24e8 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp | |||
| @@ -118,19 +118,20 @@ void GameList::LoadInterfaceLayout() | |||
| 118 | item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder()); | 118 | item_model->sort(header->sortIndicatorSection(), header->sortIndicatorOrder()); |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool deep_scan) | 121 | void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsigned int recursion) |
| 122 | { | 122 | { |
| 123 | const auto callback = [&](unsigned* num_entries_out, | 123 | const auto callback = [&](unsigned* num_entries_out, |
| 124 | const std::string& directory, | 124 | const std::string& directory, |
| 125 | const std::string& virtual_name) -> bool { | 125 | const std::string& virtual_name, |
| 126 | unsigned int recursion) -> bool { | ||
| 126 | 127 | ||
| 127 | std::string physical_name = directory + DIR_SEP + virtual_name; | 128 | std::string physical_name = directory + DIR_SEP + virtual_name; |
| 128 | 129 | ||
| 129 | if (stop_processing) | 130 | if (stop_processing) |
| 130 | return false; // Breaks the callback loop. | 131 | return false; // Breaks the callback loop. |
| 131 | 132 | ||
| 132 | if (deep_scan && FileUtil::IsDirectory(physical_name)) { | 133 | if (recursion > 0 && FileUtil::IsDirectory(physical_name)) { |
| 133 | AddFstEntriesToGameList(physical_name, true); | 134 | AddFstEntriesToGameList(physical_name, recursion - 1); |
| 134 | } else { | 135 | } else { |
| 135 | std::string filename_filename, filename_extension; | 136 | std::string filename_filename, filename_extension; |
| 136 | Common::SplitPath(physical_name, nullptr, &filename_filename, &filename_extension); | 137 | Common::SplitPath(physical_name, nullptr, &filename_filename, &filename_extension); |
| @@ -169,7 +170,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool d | |||
| 169 | void GameListWorker::run() | 170 | void GameListWorker::run() |
| 170 | { | 171 | { |
| 171 | stop_processing = false; | 172 | stop_processing = false; |
| 172 | AddFstEntriesToGameList(dir_path.toStdString(), deep_scan); | 173 | AddFstEntriesToGameList(dir_path.toStdString(), deep_scan ? 256 : 0); |
| 173 | emit Finished(); | 174 | emit Finished(); |
| 174 | } | 175 | } |
| 175 | 176 | ||