From 281f248d91db12c69c89533255d8192ef7020f86 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 4 May 2024 22:43:54 +0200 Subject: [PATCH] Qt: remove seemingly obsolete processEvents Replace them with early outs on cancel. The processEvents was probably added to allow user interaction. But it works fine without it as far as I can tell. --- rpcs3/rpcs3qt/game_list_frame.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index c3892d5fc7..fd1942eaca 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -374,12 +374,16 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after) { for (const auto& entry : fs::dir(path)) { + if (m_parsing_watcher.isCanceled()) + { + break; + } + if (!entry.is_directory || entry.name == "." || entry.name == "..") { continue; } - QApplication::processEvents(); std::lock_guard lock(m_path_mutex); m_path_entries.emplace_back(path_entry{path + entry.name, is_disc, false}); } @@ -392,6 +396,11 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after) for (const auto& [serial, path] : Emu.GetGamesConfig().get_games()) { + if (m_parsing_watcher.isCanceled()) + { + break; + } + std::string game_dir = path; game_dir.resize(game_dir.find_last_not_of('/') + 1); @@ -406,7 +415,6 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after) game_dir = game_dir.substr(0, game_dir.size() - 4); } - QApplication::processEvents(); std::lock_guard lock(m_path_mutex); m_path_entries.emplace_back(path_entry{game_dir, false, true}); } @@ -649,6 +657,11 @@ void game_list_frame::OnParsingFinished() { for (const auto& entry : fs::dir(path)) { + if (m_refresh_watcher.isCanceled()) + { + break; + } + if (!entry.is_directory || entry.name == "." || entry.name == "..") { continue;