From ad82a5c77817cceae24819a7da74d6f14d7b6241 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Sun, 18 Feb 2024 03:00:59 -0800 Subject: [PATCH] Remove one more game-removed signal --- lutris/gui/dialogs/uninstall_game.py | 3 +++ lutris/gui/lutriswindow.py | 6 +++--- lutris/gui/widgets/sidebar.py | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lutris/gui/dialogs/uninstall_game.py b/lutris/gui/dialogs/uninstall_game.py index 5eace8219..a4a10eeaa 100644 --- a/lutris/gui/dialogs/uninstall_game.py +++ b/lutris/gui/dialogs/uninstall_game.py @@ -12,6 +12,7 @@ from lutris.gui.dialogs import QuestionDialog from lutris.gui.widgets.gi_composites import GtkTemplate from lutris.util import datapath from lutris.util.jobs import AsyncCall +from lutris.util.path_cache import remove_from_path_cache from lutris.util.library_sync import delete_from_remote_library, sync_local_library from lutris.util.log import logger from lutris.util.strings import get_natural_sort_key, gtk_safe, human_size @@ -480,6 +481,7 @@ class GameRemovalRow(Gtk.ListBoxRow): # We uninstall installed games, and delete games where self.remove_from_library is true; # but we must be careful to fire the game-removed single only once. if self.game.is_installed: + remove_from_path_cache(self.game) if self.remove_from_library: self.game.uninstall(delete_files=self.delete_files, no_signal=True) self.game.delete() @@ -487,3 +489,4 @@ class GameRemovalRow(Gtk.ListBoxRow): self.game.uninstall(delete_files=self.delete_files) elif self.remove_from_library: self.game.delete() + diff --git a/lutris/gui/lutriswindow.py b/lutris/gui/lutriswindow.py index 058a66531..76c6714cf 100644 --- a/lutris/gui/lutriswindow.py +++ b/lutris/gui/lutriswindow.py @@ -36,7 +36,7 @@ from lutris.services.lutris import LutrisService from lutris.util import datapath from lutris.util.jobs import AsyncCall from lutris.util.log import logger -from lutris.util.path_cache import MISSING_GAMES, add_to_path_cache, remove_from_path_cache +from lutris.util.path_cache import MISSING_GAMES, add_to_path_cache from lutris.util.strings import get_natural_sort_key from lutris.util.system import update_desktop_icons @@ -1092,9 +1092,9 @@ class LutrisWindow(Gtk.ApplicationWindow, def on_game_installed(self, game): return True - def on_game_removed(self, game): + def on_game_removed(self, _game): """Simple method used to refresh the view""" - remove_from_path_cache(game) + self.sidebar.update_rows() self.update_missing_games_sidebar_row() self.emit("view-updated") return True diff --git a/lutris/gui/widgets/sidebar.py b/lutris/gui/widgets/sidebar.py index b11edaa01..49a39ab8f 100644 --- a/lutris/gui/widgets/sidebar.py +++ b/lutris/gui/widgets/sidebar.py @@ -360,7 +360,6 @@ class LutrisSidebar(Gtk.ListBox): GObject.add_emission_hook(Game, "game-start", self.on_game_start) GObject.add_emission_hook(Game, "game-stop", self.on_game_stop) GObject.add_emission_hook(Game, "game-updated", self.update_rows) - GObject.add_emission_hook(Game, "game-removed", self.update_rows) GObject.add_emission_hook(BaseService, "service-login", self.on_service_auth_changed) GObject.add_emission_hook(BaseService, "service-logout", self.on_service_auth_changed) GObject.add_emission_hook(BaseService, "service-games-load", self.on_service_games_updating)