mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-04 22:12:46 +01:00
AddFstEntriesToGameList - prevent loading a directory
This commit is contained in:
parent
552018c50a
commit
d24d047d45
1 changed files with 3 additions and 3 deletions
|
@ -130,9 +130,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
|
||||||
if (stop_processing)
|
if (stop_processing)
|
||||||
return false; // Breaks the callback loop.
|
return false; // Breaks the callback loop.
|
||||||
|
|
||||||
if (recursion > 0 && FileUtil::IsDirectory(physical_name)) {
|
if (!FileUtil::IsDirectory(physical_name)) {
|
||||||
AddFstEntriesToGameList(physical_name, recursion - 1);
|
|
||||||
} else {
|
|
||||||
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name);
|
std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(physical_name);
|
||||||
if (!loader)
|
if (!loader)
|
||||||
return true;
|
return true;
|
||||||
|
@ -145,6 +143,8 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
|
||||||
new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))),
|
new GameListItem(QString::fromStdString(Loader::GetFileTypeString(loader->GetFileType()))),
|
||||||
new GameListItemSize(FileUtil::GetSize(physical_name)),
|
new GameListItemSize(FileUtil::GetSize(physical_name)),
|
||||||
});
|
});
|
||||||
|
} else if (recursion > 0) {
|
||||||
|
AddFstEntriesToGameList(physical_name, recursion - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue