summaryrefslogtreecommitdiff
path: root/capplets/appearance/appearance-main.c
diff options
context:
space:
mode:
authorBalló György <[email protected]>2014-10-03 00:20:05 +0200
committerStefano Karapetsas <[email protected]>2014-10-03 08:31:39 +0200
commitac5bfbfd01210309674bd946f09f576773d06917 (patch)
tree7004916d766356cf181f43565ca5e2fb5b8ca6f8 /capplets/appearance/appearance-main.c
parentd76fe8f9c85557ee767fd15fb692f3820ebb5610 (diff)
downloadmate-control-center-ac5bfbfd01210309674bd946f09f576773d06917.tar.bz2
mate-control-center-ac5bfbfd01210309674bd946f09f576773d06917.tar.xz
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
Diffstat (limited to 'capplets/appearance/appearance-main.c')
-rw-r--r--capplets/appearance/appearance-main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/capplets/appearance/appearance-main.c b/capplets/appearance/appearance-main.c
index 7a717ad1..be4f3682 100644
--- a/capplets/appearance/appearance-main.c
+++ b/capplets/appearance/appearance-main.c
@@ -19,6 +19,7 @@
*/
#include <glib/gi18n.h>
+#include <libmate-desktop/mate-gsettings.h>
#include "appearance.h"
#include "appearance-desktop.h"
#include "appearance-font.h"
@@ -62,7 +63,12 @@ init_appearance_data (int *argc, char ***argv, GOptionContext *context)
data = g_new (AppearanceData, 1);
data->settings = g_settings_new (APPEARANCE_SCHEMA);
data->wp_settings = g_settings_new (WP_SCHEMA);
- data->caja_settings = g_settings_new (CAJA_SCHEMA);
+
+ if (mate_gsettings_schema_exists (CAJA_SCHEMA))
+ data->caja_settings = g_settings_new (CAJA_SCHEMA);
+ else
+ data->caja_settings = NULL;
+
data->interface_settings = g_settings_new (INTERFACE_SCHEMA);
data->marco_settings = g_settings_new (MARCO_SCHEMA);
data->mouse_settings = g_settings_new (MOUSE_SCHEMA);
@@ -95,7 +101,10 @@ main_window_response (GtkWidget *widget,
g_object_unref (data->thumb_factory);
g_object_unref (data->settings);
g_object_unref (data->wp_settings);
- g_object_unref (data->caja_settings);
+
+ if (data->caja_settings)
+ g_object_unref (data->caja_settings);
+
g_object_unref (data->interface_settings);
g_object_unref (data->marco_settings);
g_object_unref (data->mouse_settings);