summaryrefslogtreecommitdiff
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
parent72a1935f882ff450d19f56d0b8393c4d735ee708 (diff)
downloadmate-session-manager-9f04f5be860562d2908f0c147e0e8b22bb6996a6.tar.bz2
mate-session-manager-9f04f5be860562d2908f0c147e0e8b22bb6996a6.tar.xz
Add mate-desktop as dependency and use function from there
-rw-r--r--configure.ac2
-rw-r--r--mate-session/main.c39
2 files changed, 5 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index 8a7cbfd..fa92810 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,7 @@ GLIB_REQUIRED=2.36.0
GIO_REQUIRED=2.25.0
DBUS_GLIB_REQUIRED=0.76
UPOWER_REQUIRED=0.9.0
+MATE_DESKTOP_REQUIRED=1.9.2
case "$with_gtk" in
2.0) GTK_API_VERSION=2.0
@@ -70,6 +71,7 @@ PKG_CHECK_MODULES(MATE_SESSION,
gio-2.0 >= $GIO_REQUIRED
gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
dbus-glib-1 >= $DBUS_GLIB_REQUIRED
+ mate-desktop-2.0 >= $MATE_DESKTOP_REQUIRED
)
PKG_CHECK_MODULES(SESSION_PROPERTIES,
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);