From 052e043ea3ebfd7551707dcc229389f1b91e783c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Sat, 30 Nov 2013 13:02:57 +0100 Subject: [PATCH 1/2] Use Caja GSettings schema optionally This makes Caja dependency optional. --- plugins/filebrowser/pluma-file-browser-plugin.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/filebrowser/pluma-file-browser-plugin.c b/plugins/filebrowser/pluma-file-browser-plugin.c index 69b1e18..030ab78 100644 --- a/plugins/filebrowser/pluma-file-browser-plugin.c +++ b/plugins/filebrowser/pluma-file-browser-plugin.c @@ -623,6 +623,7 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) GdkPixbuf * pixbuf; PlumaFileBrowserStore * store; gchar *data_dir; + GSettingsSchemaSource *schema_source; data = g_new0 (PlumaFileBrowserPluginData, 1); @@ -632,7 +633,6 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) data->settings = g_settings_new (FILE_BROWSER_SCHEMA); data->onload_settings = g_settings_new (FILE_BROWSER_ONLOAD_SCHEMA); - data->caja_settings = g_settings_new (CAJA_SCHEMA); data->terminal_settings = g_settings_new (TERMINAL_SCHEMA); g_signal_connect (data->tree_widget, @@ -689,7 +689,11 @@ impl_activate (PlumaPlugin * plugin, PlumaWindow * window) restore_filter (data); /* Install caja preferences */ - install_caja_prefs (data); + schema_source = g_settings_schema_source_get_default(); + if (g_settings_schema_source_lookup (schema_source, CAJA_SCHEMA, FALSE)) { + data->caja_settings = g_settings_new (CAJA_SCHEMA); + install_caja_prefs (data); + } /* Connect signals to store the last visited location */ g_signal_connect (pluma_file_browser_widget_get_browser_view (data->tree_widget), @@ -742,9 +746,11 @@ impl_deactivate (PlumaPlugin * plugin, PlumaWindow * window) g_object_unref (data->settings); g_object_unref (data->onload_settings); - g_object_unref (data->caja_settings); g_object_unref (data->terminal_settings); + if (data->caja_settings) + g_object_unref (data->caja_settings); + remove_popup_ui (window); panel = pluma_window_get_side_panel (window); From 97336e5a4908dd82937e224f90d13cc9e260c55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= Date: Sun, 1 Dec 2013 09:53:13 +0100 Subject: [PATCH 2/2] Bump required glib version number to 2.32 It's required for the GSettingsSchemaSource API. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5777689..fe95bf6 100644 --- a/configure.ac +++ b/configure.ac @@ -290,7 +290,7 @@ esac PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""]) PKG_CHECK_MODULES(PLUMA, [ libxml-2.0 >= 2.5.0 - glib-2.0 >= 2.22.0 + glib-2.0 >= 2.32.0 $GMODULE_ADD gthread-2.0 >= 2.13.0 gio-2.0 >= 2.26.0