From ac5bfbfd01210309674bd946f09f576773d06917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Fri, 3 Oct 2014 00:20:05 +0200 Subject: Use Caja GSettings schema optionally This makes Caja dependency optional. Disable desktop font setting if no Caja present. Closes https://github.com/mate-desktop/mate-control-center/pull/119 --- capplets/common/mate-theme-apply.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'capplets/common') diff --git a/capplets/common/mate-theme-apply.c b/capplets/common/mate-theme-apply.c index 4489b302..df5a8953 100644 --- a/capplets/common/mate-theme-apply.c +++ b/capplets/common/mate-theme-apply.c @@ -23,6 +23,7 @@ #include #include +#include #include "mate-theme-apply.h" #include "gtkrc-utils.h" @@ -52,9 +53,6 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info) GSettings *marco_settings; GSettings *mouse_settings; GSettings *notification_settings = NULL; - const char * const *schemas; - gboolean schema_exists; - gint i; gchar *old_key; gint old_key_int; @@ -62,20 +60,10 @@ mate_meta_theme_set (MateThemeMetaInfo *meta_theme_info) marco_settings = g_settings_new (MARCO_SCHEMA); mouse_settings = g_settings_new (MOUSE_SCHEMA); - /* We need this because mate-control-center does not depend on mate-notification-daemon, - * and if we try to get notification theme without schema installed, gsettings crashes - * see https://bugzilla.gnome.org/show_bug.cgi?id=651225 */ - schemas = g_settings_list_schemas (); - schema_exists = FALSE; - for (i = 0; schemas[i] != NULL; i++) { - if (g_strcmp0 (schemas[i], NOTIFICATION_SCHEMA) == 0) { - schema_exists = TRUE; - break; - } - } - if (schema_exists == TRUE) { + if (mate_gsettings_schema_exists (NOTIFICATION_SCHEMA)) + { notification_settings = g_settings_new (NOTIFICATION_SCHEMA); - } + } /* Set the gtk+ key */ old_key = g_settings_get_string (interface_settings, GTK_THEME_KEY); -- cgit v1.2.1