aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-10-08 04:05:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-10-08 04:05:15 +0800
commit8fffb9de5dedc9cdc676fb89adbd03c63f0ef6e9 (patch)
treed25a23fefa8fd4530ef8dd63ebefe8aa2bf6abcf
parentad4df4c04b90b6fcb3a0a0a8cf637fc618036935 (diff)
downloadgsoc2013-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.c24
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 (