summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-11-11 13:26:19 +0300
committermonsta <[email protected]>2015-11-11 13:36:24 +0300
commitc3dadac7bb9b732fa2e174bf6470614888021b6b (patch)
tree16dcbafc4fb5ea53d1d203e34f232f9455c26466
parentdebd5bbbe3dda8934687eb66dbf0a5bfa97f5b2e (diff)
downloadmate-session-manager-c3dadac7bb9b732fa2e174bf6470614888021b6b.tar.bz2
mate-session-manager-c3dadac7bb9b732fa2e174bf6470614888021b6b.tar.xz
get rid of dependency on libmate-desktop
this introduces a bit of code duplication but makes m-s-m independent of any MATE packages which rely upon GTK+, and so makes it possible to migrate m-s-m to GTK+3 right away. of course, this change might be reverted in the future (when all of MATE becomes GTK+3 only).
-rw-r--r--configure.ac2
-rw-r--r--mate-session/main.c20
2 files changed, 17 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 74d86ac..86150c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,6 @@ 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.3
case "$with_gtk" in
2.0) GTK_API_VERSION=2.0
@@ -76,7 +75,6 @@ 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 5f6e221..967bb8a 100644
--- a/mate-session/main.c
+++ b/mate-session/main.c
@@ -39,8 +39,6 @@
#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"
@@ -537,6 +535,22 @@ void debug_changed (GSettings *settings, gchar *key, gpointer user_data)
mdm_log_set_debug (debug);
}
+static gboolean
+schema_exists (const gchar* schema_name)
+{
+ GSettingsSchemaSource *source;
+ GSettingsSchema *schema;
+ gboolean exists;
+
+ source = g_settings_schema_source_get_default();
+ schema = g_settings_schema_source_lookup (source, schema_name, FALSE);
+ exists = (schema != NULL);
+ if (schema)
+ g_settings_schema_unref (schema);
+
+ return exists;
+}
+
static void set_overlay_scroll (void)
{
GSettings *settings;
@@ -608,7 +622,7 @@ int main(int argc, char** argv)
mdm_log_init();
/* Allows to enable/disable debug from GSettings only if it is not set from argument */
- if (!debug && mate_gsettings_schema_exists(DEBUG_SCHEMA))
+ if (!debug && schema_exists(DEBUG_SCHEMA))
{
debug_settings = g_settings_new (DEBUG_SCHEMA);
g_signal_connect (debug_settings, "changed::" DEBUG_KEY, G_CALLBACK (debug_changed), NULL);