Skip to content

Commit c683b47

Browse files
committed
SaveState Manager: Fix game specific filtering
1 parent 0c4e7fc commit c683b47

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

rpcs3/rpcs3qt/savestate_manager_dialog.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -549,33 +549,38 @@ void savestate_manager_dialog::StartSavestateLoadThreads()
549549
return;
550550
}
551551

552-
std::vector<std::unique_ptr<game_savestates_data>> game_data(count);
552+
std::vector<std::unique_ptr<game_savestates_data>> game_data;
553553

554554
qRegisterMetaType<QVector<int>>("QVector<int>");
555555
QList<int> indices;
556556
for (int i = 0; i < count; ++i)
557557
{
558-
indices.append(i);
559-
560-
game_data[i] = std::make_unique<game_savestates_data>();
561-
game_data[i]->title_id = folder_list[i].toStdString();
558+
auto game_data_ptr = std::make_unique<game_savestates_data>();
559+
game_data_ptr->title_id = folder_list[i].toStdString();
562560

563561
for (const game_info& gameinfo : m_game_info)
564562
{
565-
if (gameinfo && gameinfo->info.serial == game_data[i]->title_id)
563+
if (gameinfo && gameinfo->info.serial == game_data_ptr->title_id)
566564
{
567-
game_data[i]->game_name = gameinfo->info.name;
568-
game_data[i]->game_icon_path = gameinfo->info.icon_path;
565+
game_data_ptr->game_name = gameinfo->info.name;
566+
game_data_ptr->game_icon_path = gameinfo->info.icon_path;
569567
break;
570568
}
571569
}
572570

573-
if (game_data[i]->game_name.empty())
571+
if (!game_data_ptr->game_name.empty())
574572
{
575-
game_data[i]->game_name = game_data[i]->title_id;
573+
indices.append(game_data.size());
574+
game_data.emplace_back(std::move(game_data_ptr));
576575
}
577576
}
578577

578+
if (game_data.empty())
579+
{
580+
RepaintUI(true);
581+
return;
582+
}
583+
579584
QFutureWatcher<void> future_watcher;
580585

581586
progress_dialog progress_dialog(tr("Loading savestates"), tr("Loading savestates, please wait..."), tr("Cancel"), 0, 1, false, this, Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);

0 commit comments

Comments
 (0)