[gnome-initial-setup] Add a runtime check for keys
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] Add a runtime check for keys
- Date: Thu, 1 Sep 2016 17:13:31 +0000 (UTC)
commit 5239d1351bc063736e076a3e65c463f75eef196d
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Sep 1 13:11:06 2016 -0400
Add a runtime check for keys
If we don't have the required settings, just don't show the
software page.
.../pages/software/gis-software-page.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gnome-initial-setup/pages/software/gis-software-page.c
b/gnome-initial-setup/pages/software/gis-software-page.c
index c6bb37a..9e58d47 100644
--- a/gnome-initial-setup/pages/software/gis-software-page.c
+++ b/gnome-initial-setup/pages/software/gis-software-page.c
@@ -301,9 +301,18 @@ void
gis_prepare_software_page (GisDriver *driver)
{
#ifdef ENABLE_SOFTWARE_SOURCES
- gis_driver_add_page (driver,
- g_object_new (GIS_TYPE_SOFTWARE_PAGE,
- "driver", driver,
- NULL));
+ GSettingsSchemaSource *source;
+ GSettingsSchema *schema;
+
+ source = g_settings_schema_source_get_default ();
+ schema = g_settings_schema_source_lookup (source, "org.gnome.software", TRUE);
+ if (schema != NULL && g_settings_schema_has_key (schema, "show-nonfree-software"))
+ gis_driver_add_page (driver,
+ g_object_new (GIS_TYPE_SOFTWARE_PAGE,
+ "driver", driver,
+ NULL));
+
+ if (schema != NULL)
+ g_settings_schema_unref (schema);
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]