From da13489e6b1f6f015a684c9b2c0d30297485952a Mon Sep 17 00:00:00 2001 From: Scott Balneaves Date: Fri, 24 May 2013 14:47:56 -0500 Subject: Initialize gsettings before starting mate-session-manager --- mate-session/main.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'mate-session') diff --git a/mate-session/main.c b/mate-session/main.c index da2a687..4dd8fd1 100644 --- a/mate-session/main.c +++ b/mate-session/main.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,27 @@ static gboolean failsafe = FALSE; static gboolean show_version = FALSE; static gboolean debug = FALSE; +static gboolean +initialize_gsettings (void) +{ + GSettings* settings; + time_t now = time (0); + gboolean ret; + + settings = g_settings_new (GSM_SCHEMA); + + if (!settings) + return FALSE; + + ret = g_settings_set_int (settings, "session-start", now); + + g_settings_sync (); + + g_object_unref (settings); + + return ret; +} + static void on_bus_name_lost(DBusGProxy* bus_proxy, const char* name, gpointer data) { g_warning("Lost name on bus: %s, exiting", name); @@ -505,6 +527,13 @@ int main(int argc, char** argv) */ gsm_util_setenv("MATE_DESKTOP_SESSION_ID", "this-is-deprecated"); + /* + * Make sure gsettings is set up correctly. If not, then bail. + */ + + if (initialize_gsettings () != TRUE) + exit (1); + client_store = gsm_store_new(); xsmp_server = gsm_xsmp_server_new(client_store); -- cgit v1.2.1