summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2023-04-06 11:00:51 -0500
committerMichael Catanzaro <mcatanzaro@redhat.com>2023-04-06 11:00:51 -0500
commitdd19c04b45b6a1d8f23ef090db25d45dc3b1392b (patch)
tree8ad6ed6bec853bc59510989c003b8751bf4e06e1
parent3a65f3ff265163a13d9d7512d31bdb3c925d721f (diff)
downloadgnome-initial-setup-dd19c04b45b6a1d8f23ef090db25d45dc3b1392b.tar.gz
privacy: consider switch visibility when setting settings
I don't think this is actually needed currently, but it provides an extra level of safety. If the switches are not visible then the settings need to be off.
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.c b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
index 48bcd85..b0e71f5 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
@@ -157,10 +157,10 @@ gis_privacy_page_apply (GisPage *gis_page,
GisPrivacyPagePrivate *priv = gis_privacy_page_get_instance_private (page);
gboolean active;
- active = gtk_switch_get_active (GTK_SWITCH (priv->location_switch));
+ active = gtk_widget_is_visible (priv->location_switch) && gtk_switch_get_active (GTK_SWITCH (priv->location_switch));
g_settings_set_boolean (priv->location_settings, "enabled", active);
- active = gtk_switch_get_active (GTK_SWITCH (priv->reporting_switch));
+ active = gtk_widget_is_visible (priv->reporting_switch) && gtk_switch_get_active (GTK_SWITCH (priv->reporting_switch));
g_settings_set_boolean (priv->privacy_settings, "report-technical-problems", active);
return FALSE;