|
|
|
@ -234,8 +234,8 @@ GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs_,
|
|
|
|
|
const PlayTime::PlayTimeManager& play_time_manager_,
|
|
|
|
|
Core::System& system_)
|
|
|
|
|
: vfs{std::move(vfs_)}, provider{provider_}, game_dirs{game_dirs_},
|
|
|
|
|
compatibility_list{compatibility_list_}, play_time_manager{play_time_manager_}, system{
|
|
|
|
|
system_} {
|
|
|
|
|
compatibility_list{compatibility_list_}, play_time_manager{play_time_manager_},
|
|
|
|
|
system{system_} {
|
|
|
|
|
// We want the game list to manage our lifetime.
|
|
|
|
|
setAutoDelete(false);
|
|
|
|
|
}
|
|
|
|
@ -330,13 +330,13 @@ void GameListWorker::AddTitlesToGameList(GameListDir* parent_dir) {
|
|
|
|
|
|
|
|
|
|
auto entry = MakeGameListEntry(file->GetFullPath(), name, file->GetSize(), icon, *loader,
|
|
|
|
|
program_id, compatibility_list, play_time_manager, patch);
|
|
|
|
|
RecordEvent([=](GameList* game_list) { game_list->AddEntry(entry, parent_dir); });
|
|
|
|
|
RecordEvent([=](GameList* game_list) { game_list->AddRootEntry(entry); });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_path, bool deep_scan,
|
|
|
|
|
GameListDir* parent_dir) {
|
|
|
|
|
const auto callback = [this, target, parent_dir](const std::filesystem::path& path) -> bool {
|
|
|
|
|
const auto callback = [this, target](const std::filesystem::path& path) -> bool {
|
|
|
|
|
if (stop_requested) {
|
|
|
|
|
// Breaks the callback loop.
|
|
|
|
|
return false;
|
|
|
|
@ -408,8 +408,7 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa
|
|
|
|
|
physical_name, name, Common::FS::GetSize(physical_name), icon, *loader,
|
|
|
|
|
id, compatibility_list, play_time_manager, patch);
|
|
|
|
|
|
|
|
|
|
RecordEvent(
|
|
|
|
|
[=](GameList* game_list) { game_list->AddEntry(entry, parent_dir); });
|
|
|
|
|
RecordEvent([=](GameList* game_list) { game_list->AddRootEntry(entry); });
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
std::vector<u8> icon;
|
|
|
|
@ -425,8 +424,7 @@ void GameListWorker::ScanFileSystem(ScanTarget target, const std::string& dir_pa
|
|
|
|
|
physical_name, name, Common::FS::GetSize(physical_name), icon, *loader,
|
|
|
|
|
program_id, compatibility_list, play_time_manager, patch);
|
|
|
|
|
|
|
|
|
|
RecordEvent(
|
|
|
|
|
[=](GameList* game_list) { game_list->AddEntry(entry, parent_dir); });
|
|
|
|
|
RecordEvent([=](GameList* game_list) { game_list->AddRootEntry(entry); });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (is_dir) {
|
|
|
|
@ -448,9 +446,11 @@ void GameListWorker::run() {
|
|
|
|
|
watch_list.clear();
|
|
|
|
|
provider->ClearAllEntries();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
const auto DirEntryReady = [&](GameListDir* game_list_dir) {
|
|
|
|
|
RecordEvent([=](GameList* game_list) { game_list->AddDirEntry(game_list_dir); });
|
|
|
|
|
};
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
for (UISettings::GameDir& game_dir : game_dirs) {
|
|
|
|
|
if (stop_requested) {
|
|
|
|
@ -459,20 +459,20 @@ void GameListWorker::run() {
|
|
|
|
|
|
|
|
|
|
if (game_dir.path == std::string("SDMC")) {
|
|
|
|
|
auto* const game_list_dir = new GameListDir(game_dir, GameListItemType::SdmcDir);
|
|
|
|
|
DirEntryReady(game_list_dir);
|
|
|
|
|
// DirEntryReady(game_list_dir);
|
|
|
|
|
AddTitlesToGameList(game_list_dir);
|
|
|
|
|
} else if (game_dir.path == std::string("UserNAND")) {
|
|
|
|
|
auto* const game_list_dir = new GameListDir(game_dir, GameListItemType::UserNandDir);
|
|
|
|
|
DirEntryReady(game_list_dir);
|
|
|
|
|
// DirEntryReady(game_list_dir);
|
|
|
|
|
AddTitlesToGameList(game_list_dir);
|
|
|
|
|
} else if (game_dir.path == std::string("SysNAND")) {
|
|
|
|
|
auto* const game_list_dir = new GameListDir(game_dir, GameListItemType::SysNandDir);
|
|
|
|
|
DirEntryReady(game_list_dir);
|
|
|
|
|
// DirEntryReady(game_list_dir);
|
|
|
|
|
AddTitlesToGameList(game_list_dir);
|
|
|
|
|
} else {
|
|
|
|
|
watch_list.append(QString::fromStdString(game_dir.path));
|
|
|
|
|
auto* const game_list_dir = new GameListDir(game_dir);
|
|
|
|
|
DirEntryReady(game_list_dir);
|
|
|
|
|
// DirEntryReady(game_list_dir);
|
|
|
|
|
ScanFileSystem(ScanTarget::FillManualContentProvider, game_dir.path, game_dir.deep_scan,
|
|
|
|
|
game_list_dir);
|
|
|
|
|
ScanFileSystem(ScanTarget::PopulateGameList, game_dir.path, game_dir.deep_scan,
|
|
|
|
|