[anjal] Add function to check for empty user accounts.



commit f9b12c6b72e73de76db3c8adc60ca618e566b294
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Apr 29 07:39:48 2009 +0530

    Add function to check for empty user accounts.
---
 src/mail-shell.c |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/src/mail-shell.c b/src/mail-shell.c
index 53f53da..5933789 100644
--- a/src/mail-shell.c
+++ b/src/mail-shell.c
@@ -24,6 +24,7 @@
 #  include <config.h>
 #endif
 #include <glib/gi18n.h>
+#include <gconf/gconf-client.h>
 #include "mail-shell.h"
 #include "mail-view.h"
 #include "mail-component.h"
@@ -224,6 +225,26 @@ ms_delete_event (MailShell *shell, GdkEvent *event, gpointer data)
 	mail_shell_quit (shell);
 }
 
+static gboolean 
+ms_check_new ()
+{
+	GConfClient *client;
+	GSList *accounts;
+
+	client = gconf_client_get_default ();
+	accounts = gconf_client_get_list (client, "/apps/evolution/mail/accounts", GCONF_VALUE_STRING, NULL);
+	g_object_unref (client);
+
+	if (accounts != NULL) {
+		g_slist_foreach (accounts, (GFunc) g_free, NULL);
+		g_slist_free (accounts);
+
+		return FALSE;
+	}
+	
+	return TRUE;
+}
+
 void
 mail_shell_construct (MailShell *shell)
 {
@@ -313,7 +334,8 @@ mail_shell_construct (MailShell *shell)
 	g_signal_connect (priv->quit, "clicked", G_CALLBACK(mail_shell_quit_cb), shell);
 	
 	gtk_container_add ((GtkContainer *)shell, priv->box);
-
+	
+	printf("NEW Setup ? %d\n", ms_check_new());
 	shell->mail_component = mail_component_create (shell, FALSE);
 	priv->side_pane = gtk_hpaned_new ();
 	tmp = gtk_vpaned_new ();



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