diff options
Diffstat (limited to 'src/citra_qt/game_list.cpp')
| -rw-r--r-- | src/citra_qt/game_list.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index e925f08a7..1f8d69a03 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp | |||
| @@ -119,13 +119,14 @@ void GameList::LoadInterfaceLayout(QSettings& settings) | |||
| 119 | 119 | ||
| 120 | void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool deep_scan) | 120 | void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool deep_scan) |
| 121 | { | 121 | { |
| 122 | const auto callback = [&](const std::string& directory, | 122 | const auto callback = [&](unsigned* num_entries_out, |
| 123 | const std::string& virtual_name) -> int { | 123 | const std::string& directory, |
| 124 | const std::string& virtual_name) -> bool { | ||
| 124 | 125 | ||
| 125 | std::string physical_name = directory + DIR_SEP + virtual_name; | 126 | std::string physical_name = directory + DIR_SEP + virtual_name; |
| 126 | 127 | ||
| 127 | if (stop_processing) | 128 | if (stop_processing) |
| 128 | return -1; // A negative return value breaks the callback loop. | 129 | return false; // Breaks the callback loop. |
| 129 | 130 | ||
| 130 | if (deep_scan && FileUtil::IsDirectory(physical_name)) { | 131 | if (deep_scan && FileUtil::IsDirectory(physical_name)) { |
| 131 | AddFstEntriesToGameList(physical_name, true); | 132 | AddFstEntriesToGameList(physical_name, true); |
| @@ -135,11 +136,11 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool d | |||
| 135 | 136 | ||
| 136 | Loader::FileType guessed_filetype = Loader::GuessFromExtension(filename_extension); | 137 | Loader::FileType guessed_filetype = Loader::GuessFromExtension(filename_extension); |
| 137 | if (guessed_filetype == Loader::FileType::Unknown) | 138 | if (guessed_filetype == Loader::FileType::Unknown) |
| 138 | return 0; | 139 | return true; |
| 139 | Loader::FileType filetype = Loader::IdentifyFile(physical_name); | 140 | Loader::FileType filetype = Loader::IdentifyFile(physical_name); |
| 140 | if (filetype == Loader::FileType::Unknown) { | 141 | if (filetype == Loader::FileType::Unknown) { |
| 141 | LOG_WARNING(Frontend, "File %s is of indeterminate type and is possibly corrupted.", physical_name.c_str()); | 142 | LOG_WARNING(Frontend, "File %s is of indeterminate type and is possibly corrupted.", physical_name.c_str()); |
| 142 | return 0; | 143 | return true; |
| 143 | } | 144 | } |
| 144 | if (guessed_filetype != filetype) { | 145 | if (guessed_filetype != filetype) { |
| 145 | LOG_WARNING(Frontend, "Filetype and extension of file %s do not match.", physical_name.c_str()); | 146 | LOG_WARNING(Frontend, "Filetype and extension of file %s do not match.", physical_name.c_str()); |
| @@ -152,9 +153,10 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, bool d | |||
| 152 | }); | 153 | }); |
| 153 | } | 154 | } |
| 154 | 155 | ||
| 155 | return 0; // We don't care about the found entries | 156 | return true; |
| 156 | }; | 157 | }; |
| 157 | FileUtil::ScanDirectoryTreeAndCallback(dir_path, callback); | 158 | |
| 159 | FileUtil::ForeachDirectoryEntry(nullptr, dir_path, callback); | ||
| 158 | } | 160 | } |
| 159 | 161 | ||
| 160 | void GameListWorker::run() | 162 | void GameListWorker::run() |