[evolution] Bug 596952 - Offline mode does not stick when set from command line



commit 8fffb9de5dedc9cdc676fb89adbd03c63f0ef6e9
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Oct 7 15:05:15 2009 -0500

    Bug 596952 - Offline mode does not stick when set from command line

 shell/main.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index 32df7b3..9b03c7c 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 (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]