diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-10-08 04:05:15 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-10-08 04:05:15 +0800 |
commit | 8fffb9de5dedc9cdc676fb89adbd03c63f0ef6e9 (patch) | |
tree | d25a23fefa8fd4530ef8dd63ebefe8aa2bf6abcf | |
parent | ad4df4c04b90b6fcb3a0a0a8cf637fc618036935 (diff) | |
download | gsoc2013-evolution-8fffb9de5dedc9cdc676fb89adbd03c63f0ef6e9.tar.gz gsoc2013-evolution-8fffb9de5dedc9cdc676fb89adbd03c63f0ef6e9.tar.zst gsoc2013-evolution-8fffb9de5dedc9cdc676fb89adbd03c63f0ef6e9.zip |
Bug 596952 - Offline mode does not stick when set from command line
-rw-r--r-- | shell/main.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/shell/main.c b/shell/main.c index 32df7b3c5f..9b03c7c4cc 100644 --- a/shell/main.c +++ b/shell/main.c @@ -421,26 +421,32 @@ create_default_shell (void) EShell *shell; GConfClient *client; gboolean online = TRUE; + const gchar *key; GError *error = NULL; client = gconf_client_get_default (); + key = "/apps/evolution/shell/start_offline"; - if (start_online) + /* Requesting online or offline mode from the command-line + * should be persistent, just like selecting it in the UI. */ + + if (start_online) { online = TRUE; - else if (start_offline) + gconf_client_set_bool (client, key, FALSE, &error); + } else if (start_offline) { online = FALSE; - else { - const gchar *key; + gconf_client_set_bool (client, key, TRUE, &error); + } else { gboolean value; - key = "/apps/evolution/shell/start_offline"; value = gconf_client_get_bool (client, key, &error); if (error == NULL) online = !value; - else { - g_warning ("%s", error->message); - g_error_free (error); - } + } + + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); } shell = g_object_new ( |