summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Comstedt <[email protected]>2016-06-21 12:35:01 +0200
committermonsta <[email protected]>2017-03-12 14:01:33 +0400
commit5a15fc2881cf69f1b88e1d561b8323b59a2d5c2e (patch)
tree3e24f221ee24260e9d7a5826fabf979efe943a29
parent9ef0b38b190185e8f6a36f586e81fd027abdef86 (diff)
downloadatril-5a15fc2881cf69f1b88e1d561b8323b59a2d5c2e.tar.bz2
atril-5a15fc2881cf69f1b88e1d561b8323b59a2d5c2e.tar.xz
shell: Add guards for org.mate.interface schema not existing
-rw-r--r--shell/ev-window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 4f66193f..30b2be9e 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1476,7 +1476,8 @@ ev_window_setup_toolbar_flags (EvWindow *ev_window)
{
EggTbModelFlags flags = egg_toolbars_model_get_flags(ev_window->priv->toolbars_model, 0);
char *style;
- if ((style = g_settings_get_string (ev_window->priv->interface_settings, MATE_INTERFACE_TB_STYLE))) {
+ if (ev_window->priv->interface_settings &&
+ (style = g_settings_get_string (ev_window->priv->interface_settings, MATE_INTERFACE_TB_STYLE))) {
flags &= ~EGG_TB_MODEL_STYLES_MASK;
if (!strcmp (style, "both")) {
flags |= EGG_TB_MODEL_BOTH;
@@ -7672,11 +7673,17 @@ ev_window_init (EvWindow *ev_window)
"model", ev_window->priv->toolbars_model,
NULL));
- ev_window->priv->interface_settings = g_settings_new (MATE_INTERFACE_SCHEMA);
- g_signal_connect (ev_window->priv->interface_settings,
- "changed",
- G_CALLBACK (interface_changed),
- ev_window);
+ GSettingsSchema *schema_mate_interface_schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default(), MATE_INTERFACE_SCHEMA, FALSE);
+ if (schema_mate_interface_schema != NULL) {
+ g_settings_schema_unref (schema_mate_interface_schema);
+
+ if (!ev_window->priv->interface_settings)
+ ev_window->priv->interface_settings = g_settings_new (MATE_INTERFACE_SCHEMA);
+ g_signal_connect (ev_window->priv->interface_settings,
+ "changed",
+ G_CALLBACK (interface_changed),
+ ev_window);
+ }
ev_window_setup_toolbar_flags (ev_window);
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (ev_window->priv->toolbar)),