summaryrefslogtreecommitdiff
path: root/mate-session
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-07-12 16:09:33 +0200
committerStefano Karapetsas <[email protected]>2014-07-12 16:09:33 +0200
commit9f04f5be860562d2908f0c147e0e8b22bb6996a6 (patch)
tree775e316443527e722de9317a9fe96fa4246e675b /mate-session
parent72a1935f882ff450d19f56d0b8393c4d735ee708 (diff)
downloadmate-session-manager-9f04f5be860562d2908f0c147e0e8b22bb6996a6.tar.bz2
mate-session-manager-9f04f5be860562d2908f0c147e0e8b22bb6996a6.tar.xz
Add mate-desktop as dependency and use function from there
Diffstat (limited to 'mate-session')
-rw-r--r--mate-session/main.c39
1 files changed, 3 insertions, 36 deletions
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 <dbus/dbus-glib-bindings.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include <libmate-desktop/mate-gsettings.h>
+
#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);