From 9f04f5be860562d2908f0c147e0e8b22bb6996a6 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Sat, 12 Jul 2014 16:09:33 +0200 Subject: Add mate-desktop as dependency and use function from there --- mate-session/main.c | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) (limited to 'mate-session') diff --git a/mate-session/main.c b/mate-session/main.c index 5f123fd..1039368 100644 --- a/mate-session/main.c +++ b/mate-session/main.c @@ -39,6 +39,8 @@ #include #include +#include + #include "mdm-signal-handler.h" #include "mdm-log.h" @@ -527,41 +529,6 @@ static gboolean require_dbus_session(int argc, char** argv, GError** error) return TRUE; } -// Copied from mate-desktop -gboolean -_gsettings_schema_exists (const gchar* schema) -{ -#if GLIB_CHECK_VERSION (2, 40, 0) - GSettingsSchemaSource *schema_source; - GSettingsSchema *schema_schema; -#else - const char * const *schemas; - gint i; -#endif - gboolean schema_exists; - -#if GLIB_CHECK_VERSION (2, 40, 0) - schema_source = g_settings_schema_source_get_default(); - schema_schema = g_settings_schema_source_lookup (schema_source, schema, FALSE); - schema_exists = (schema_schema != NULL); - if (schema_schema) - g_settings_schema_unref (schema_schema); -#else - schemas = g_settings_list_schemas (); - schema_exists = FALSE; - - for (i = 0; schemas[i] != NULL; i++) { - if (g_strcmp0 (schemas[i], schema) == 0) { - schema_exists = TRUE; - break; - } - } -#endif - - return schema_exists; -} - - void debug_changed (GSettings *settings, gchar *key, gpointer user_data) { debug = g_settings_get_boolean (settings, DEBUG_KEY); @@ -620,7 +587,7 @@ int main(int argc, char** argv) } /* Allows to enable/disable debug from GSettings only if it is not set from argument */ - if (!debug && _gsettings_schema_exists(DEBUG_SCHEMA)) + if (!debug && mate_gsettings_schema_exists(DEBUG_SCHEMA)) { debug_settings = g_settings_new (DEBUG_SCHEMA); debug = g_settings_get_boolean (debug_settings, DEBUG_KEY); -- cgit v1.2.1