From 766cc2d42f9a10d63ee19b6bd39ce5c0a9e7dd5b Mon Sep 17 00:00:00 2001 From: Megamouse Date: Thu, 10 Jun 2021 12:55:08 +0200 Subject: [PATCH] Qt: fix empty game list phenomenon --- 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 2274693d72..274a35a3b0 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -133,6 +133,12 @@ game_list_frame::game_list_frame(std::shared_ptr gui_settings, std connect(&m_refresh_watcher, &QFutureWatcher::finished, this, &game_list_frame::OnRefreshFinished); connect(&m_refresh_watcher, &QFutureWatcher::canceled, this, [this]() { + if (m_repaint_watcher.isRunning()) + { + m_repaint_watcher.cancel(); + m_repaint_watcher.waitForFinished(); + } + m_path_list.clear(); m_game_data.clear(); m_serials.clear(); @@ -430,7 +436,10 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after) if (m_refresh_watcher.isRunning()) { - m_refresh_watcher.cancel(); + if (from_drive) + { + m_refresh_watcher.cancel(); + } m_refresh_watcher.waitForFinished(); } @@ -672,6 +681,7 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after) m_games.push(std::make_shared(gui_game_info{game, qt_cat, compat, {}, {}, hasCustomConfig, hasCustomPadConfig, has_hover_gif, nullptr})); })); + return; } @@ -701,6 +711,12 @@ void game_list_frame::Refresh(const bool from_drive, const bool scroll_after) void game_list_frame::OnRefreshFinished() { + if (m_repaint_watcher.isRunning()) + { + m_repaint_watcher.cancel(); + m_repaint_watcher.waitForFinished(); + } + for (auto&& g : m_games.pop_all()) { m_game_data.push_back(g);