From 954d83b6a04887af668e3bde2fe2ec6cc4dbe09b Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 19 Jul 2021 23:43:05 +0200 Subject: [PATCH] Qt: fix BatchCreatePPUCaches cancel --- rpcs3/rpcs3qt/game_list_frame.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index bb6fb12b1a..14dc1e7562 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -1632,6 +1632,7 @@ void game_list_frame::BatchCreatePPUCaches() pdlg->setAutoClose(false); pdlg->setAutoReset(false); pdlg->show(); + QApplication::processEvents(); u32 created = 0; @@ -1644,7 +1645,6 @@ void game_list_frame::BatchCreatePPUCaches() { if (pdlg->wasCanceled()) { - game_list_log.notice("PPU Cache Batch Creation was canceled"); break; } QApplication::processEvents(); @@ -1653,12 +1653,28 @@ void game_list_frame::BatchCreatePPUCaches() { while (!Emu.IsStopped()) { + if (pdlg->wasCanceled()) + { + break; + } QApplication::processEvents(); } pdlg->SetValue(++created); } } + if (pdlg->wasCanceled()) + { + game_list_log.notice("PPU Cache Batch Creation was canceled"); + + if (!Emu.IsStopped()) + { + QApplication::processEvents(); + Emu.Stop(); + } + return; + } + pdlg->setLabelText(tr("Created PPU Caches for %n title(s)", "", created)); pdlg->setCancelButtonText(tr("OK")); QApplication::beep();