From 0889aa883ea1b4e9a122ee765517f3c1422e2161 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Sun, 30 Nov 2025 12:59:32 +0500 Subject: [PATCH] fix: refresh button refresh custom data too now Signed-off-by: Boris Yumankulov --- portprotonqt/main_window.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/portprotonqt/main_window.py b/portprotonqt/main_window.py index 0d7966c..70e8672 100644 --- a/portprotonqt/main_window.py +++ b/portprotonqt/main_window.py @@ -1200,8 +1200,19 @@ class MainWindow(QMainWindow): self.progress_bar.setRange(0, 0) # Indeterminate self.update_status_message.emit(_("Refreshing game library..."), 0) + # Clear the game card cache to force reload of custom data + if hasattr(self, 'game_library_manager') and self.game_library_manager: + # Clear the cache to ensure custom data is reloaded + self.game_library_manager.game_card_cache.clear() + self.game_library_manager.pending_images.clear() + # Clear search indices to rebuild with fresh data + if hasattr(self.game_library_manager, '_build_search_indices'): + # Mark for full rebuild of search indices + self.game_library_manager.dirty = True # Force full update + # Reload games using the existing loadGames functionality - QTimer.singleShot(0, self.loadGames) + # Use a small delay to allow UI to update before starting the refresh + QTimer.singleShot(50, lambda: self.loadGames()) def on_search_text_changed(self, text: str): """Search text change handler with debounce."""