[gtk+/gtk-3-14] Deal with absence of org.gnome.desktop.interface schema
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-14] Deal with absence of org.gnome.desktop.interface schema
- Date: Sun, 11 Jan 2015 19:08:00 +0000 (UTC)
commit 6429a66258bc5c911d84d47b2d932d0778cce710
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 11 14:07:10 2015 -0500
Deal with absence of org.gnome.desktop.interface schema
This should fully address
https://bugzilla.gnome.org/show_bug.cgi?id=742664
in the 3.14 branch.
gtk/inspector/css-editor.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/gtk/inspector/css-editor.c b/gtk/inspector/css-editor.c
index 7bfaa26..80e9d64 100644
--- a/gtk/inspector/css-editor.c
+++ b/gtk/inspector/css-editor.c
@@ -209,7 +209,17 @@ save_clicked (GtkToolButton *button,
static void
apply_system_font (GtkInspectorCssEditor *ce)
{
- GSettings *s = g_settings_new ("org.gnome.desktop.interface");
+ GSettingsSchemaSource *source;
+ GSettingsSchema *schema;
+ GSettings *s;
+
+ source = g_settings_schema_source_get_default ();
+ schema = g_settings_schema_source_lookup (source, "org.gnome.desktop.interace", FALSE);
+ if (schema == NULL)
+ return;
+
+ s = g_settings_new_full (schema, NULL, NULL);
+
gchar *font_name = g_settings_get_string (s, "monospace-font-name");
PangoFontDescription *font_desc = pango_font_description_from_string (font_name);
@@ -358,7 +368,6 @@ destroy_provider (GtkInspectorCssEditor *ce)
NULL);
}
}
-
static void
gtk_inspector_css_editor_init (GtkInspectorCssEditor *ce)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]