From 4054913dc296960f9dcb5a40dc039909196e60c3 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 3 Feb 2020 17:49:21 +0000 Subject: [PATCH] malcontent-control: Fix losing user changes when apps are installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the user has the restrict applications dialogue open and has made some changes, then installs/uninstalls a flatpak (for example) from gnome-software in another window, then the list of apps in the restrict applications dialogue will be reloaded and the user’s changes will be lost. Prevent that by not reloading when the set of installed apps changes. This is not a long-term solution: ideally we’d diff the changes against the list of apps in the restrict applications dialogue and only update what’s changed. Signed-off-by: Philip Withnall --- malcontent-control/restrict-applications-selector.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/malcontent-control/restrict-applications-selector.c b/malcontent-control/restrict-applications-selector.c index b6ddb83..6fb9d4b 100644 --- a/malcontent-control/restrict-applications-selector.c +++ b/malcontent-control/restrict-applications-selector.c @@ -478,9 +478,14 @@ static void app_info_changed_cb (GAppInfoMonitor *monitor, gpointer user_data) { + /* FIXME: We should update the list of apps here, but we can’t call + * reload_apps() because that will dump and reload the entire list, losing + * any changes the user has already made to the set of switches. We need + * something more fine-grained. MctRestrictApplicationsSelector *self = MCT_RESTRICT_APPLICATIONS_SELECTOR (user_data); reload_apps (self); + */ } /* Will return %NULL if @flatpak_id is not installed. */