[gnome-software/wip/hughsie/fix-alternates-regression] details-page: Only connect up settings changed once
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/hughsie/fix-alternates-regression] details-page: Only connect up settings changed once
- Date: Mon, 8 Oct 2018 19:15:37 +0000 (UTC)
commit 51ea1caff4c4676d8f2085defeb7d45c1578e77c
Author: Richard Hughes <richard hughsie com>
Date: Mon Oct 8 19:48:51 2018 +0100
details-page: Only connect up settings changed once
This is currently added every time the application changes...
src/gs-details-page.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 17cc6a69..f97807b1 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1892,10 +1892,10 @@ gs_details_page_reload (GsPage *page)
}
static void
-settings_changed_cb (GsDetailsPage *self,
- const gchar *key,
- gpointer data)
+settings_changed_cb (GsDetailsPage *self, const gchar *key, gpointer data)
{
+ if (self->app == NULL)
+ return;
if (g_strcmp0 (key, "show-nonfree-ui") == 0) {
gs_details_page_refresh_all (self);
}
@@ -1954,10 +1954,6 @@ gs_details_page_set_app (GsDetailsPage *self, GsApp *app)
/* change widgets */
gs_details_page_refresh_all (self);
-
- g_signal_connect_swapped (self->settings, "changed",
- G_CALLBACK (settings_changed_cb),
- self);
}
GsApp *
@@ -2622,6 +2618,9 @@ gs_details_page_init (GsDetailsPage *self)
self->session = soup_session_new_with_options (SOUP_SESSION_USER_AGENT, gs_user_agent (),
NULL);
self->settings = g_settings_new ("org.gnome.software");
+ g_signal_connect_swapped (self->settings, "changed",
+ G_CALLBACK (settings_changed_cb),
+ self);
self->size_group_origin_popover = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
gtk_list_box_set_header_func (GTK_LIST_BOX (self->list_box_addons),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]