diff options
author | Scott Balneaves <[email protected]> | 2013-05-24 14:47:56 -0500 |
---|---|---|
committer | Scott Balneaves <[email protected]> | 2013-05-24 14:47:56 -0500 |
commit | da13489e6b1f6f015a684c9b2c0d30297485952a (patch) | |
tree | e61c3923480c3df3d61979b55676ab8c304773d9 /mate-session | |
parent | 9557bf37246c71393e55c1fff38c322e47d3f12c (diff) | |
download | mate-session-manager-da13489e6b1f6f015a684c9b2c0d30297485952a.tar.bz2 mate-session-manager-da13489e6b1f6f015a684c9b2c0d30297485952a.tar.xz |
Initialize gsettings before starting mate-session-manager
Diffstat (limited to 'mate-session')
-rw-r--r-- | mate-session/main.c | 29 |
1 files changed, 29 insertions, 0 deletions
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 <string.h> #include <unistd.h> #include <errno.h> +#include <time.h> #include <glib/gi18n.h> #include <glib.h> @@ -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); |