summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@redhat.com>2023-04-06 11:04:02 -0500
committerMichael Catanzaro <mcatanzaro@redhat.com>2023-04-06 11:04:02 -0500
commit1ad293f851b32e8d8481ff716b4f9f355323e757 (patch)
tree1eff3ce6d1c1977e4a03045ff18b6409baf623d7
parentdd19c04b45b6a1d8f23ef090db25d45dc3b1392b (diff)
downloadgnome-initial-setup-1ad293f851b32e8d8481ff716b4f9f355323e757.tar.gz
privacy: don't show ABRT switch if distro name is missing
GNOME does not run an ABRT server, so it does not make sense to use "GNOME" as the fallback name if the distro name is missing from /etc/os-release. In this case, let's just not show the ABRT option at all, and keep it disabled. This shouldn't affect much in practice, at least not today, because currently only Fedora has an ABRT server, and if other distros were to use ABRT in the future they would probably provide their name in /etc/os-release. But might as well be careful in what we show to users here.
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.c30
-rw-r--r--gnome-initial-setup/pages/privacy/gis-privacy-page.ui1
2 files changed, 16 insertions, 15 deletions
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.c b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
index b0e71f5..94632bb 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.c
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.c
@@ -52,7 +52,7 @@ typedef struct _GisPrivacyPagePrivate GisPrivacyPagePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (GisPrivacyPage, gis_privacy_page, GIS_TYPE_PAGE);
-static void
+static gboolean
update_os_data (GisPrivacyPage *page)
{
GisPrivacyPagePrivate *priv = gis_privacy_page_get_instance_private (page);
@@ -61,13 +61,12 @@ update_os_data (GisPrivacyPage *page)
g_autofree char *subtitle = NULL;
if (!name)
- name = g_strdup ("GNOME");
+ return FALSE;
if (privacy_policy)
{
/* Translators: the first parameter here is the name of a distribution,
- * like "Fedora" or "Ubuntu". It falls back to "GNOME" if we can't
- * detect any distribution.
+ * like "Fedora" or "Ubuntu".
*/
subtitle = g_strdup_printf (_("Sends technical reports that have personal information automatically "
"removed. Data is collected by %1$s (<a href='%2$s'>privacy policy</a>)."),
@@ -76,13 +75,13 @@ update_os_data (GisPrivacyPage *page)
else
{
/* Translators: the parameter here is the name of a distribution,
- * like "Fedora" or "Ubuntu". It falls back to "GNOME" if we can't
- * detect any distribution.
+ * like "Fedora" or "Ubuntu".
*/
subtitle = g_strdup_printf (_("Sends technical reports that have personal information automatically "
"removed. Data is collected by %s."), name);
}
gtk_label_set_markup (GTK_LABEL (priv->reporting_label), subtitle);
+ return TRUE;
}
static void
@@ -124,15 +123,16 @@ gis_privacy_page_constructed (GObject *object)
gtk_switch_set_active (GTK_SWITCH (priv->location_switch), TRUE);
gtk_switch_set_active (GTK_SWITCH (priv->reporting_switch), TRUE);
- update_os_data (page);
-
- priv->abrt_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
- "org.freedesktop.problems.daemon",
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- abrt_appeared_cb,
- abrt_vanished_cb,
- page,
- NULL);
+ if (update_os_data (page))
+ {
+ priv->abrt_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
+ "org.freedesktop.problems.daemon",
+ G_BUS_NAME_WATCHER_FLAGS_NONE,
+ abrt_appeared_cb,
+ abrt_vanished_cb,
+ page,
+ NULL);
+ }
}
static void
diff --git a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
index 6c48d5f..9ce8447 100644
--- a/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
+++ b/gnome-initial-setup/pages/privacy/gis-privacy-page.ui
@@ -54,6 +54,7 @@
<child>
<object class="AdwPreferencesGroup" id="reporting_group">
<property name="margin-top">12</property>
+ <property name="visible">False</property>
<child>
<object class="AdwActionRow" id="reporting_row">
<property name="title" translatable="yes">Automatic Problem Reporting</property>