evolution r36673 - branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi



Author: msuman
Date: Wed Oct 22 04:10:18 2008
New Revision: 36673
URL: http://svn.gnome.org/viewvc/evolution?rev=36673&view=rev

Log:
MAPI: Loads of code cleanup, remove most compilation warnings.

Added:
   branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.h
Modified:
   branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/ChangeLog
   branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/Makefile.am
   branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.c
   branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.h
   branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.c

Modified: branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/Makefile.am
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/Makefile.am	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/Makefile.am	Wed Oct 22 04:10:18 2008
@@ -6,7 +6,7 @@
 	-I$(top_builddir)/mail 				\
 	-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" 		\
 	-DCONNECTOR_GLADEDIR=\""$(gladedir)"\" 		\
-	-DLIBAMPI_LDIF_DIR=\""$(libmapi_ldif_dir)"\"	\
+	-DLIBMAPI_LDIF_DIR=\""$(libmapi_ldif_dir)"\"	\
 	$(CAMEL_CFLAGS)					\
 	$(EVOLUTION_CALENDAR_CFLAGS) \
 	$(EVOLUTION_ADDRESSBOOK_CFLAGS) \
@@ -21,7 +21,9 @@
 
 liborg_gnome_exchange_mapi_la_SOURCES = 		\
 	exchange-mapi-account-setup.c			\
-	exchange-account-listener.c
+	exchange-mapi-account-setup.h			\
+	exchange-account-listener.c			\
+	exchange-account-listener.h
 
 liborg_gnome_exchange_mapi_la_LIBADD = 			\
 	$(top_builddir)/e-util/libeutil.la 			\

Modified: branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.c	Wed Oct 22 04:10:18 2008
@@ -25,14 +25,19 @@
 #include <config.h>
 #endif
 
-#include <exchange-account-listener.h>
+#include "exchange-account-listener.h"
+#include "exchange-mapi-account-setup.h"
 #include <string.h>
 #include <camel/camel-i18n.h>
 #include <libedataserverui/e-passwords.h>
 #include "e-util/e-error.h"
 #include <libedataserver/e-account.h>
 #include <libecal/e-cal.h>
-
+#include <libedataserver/e-account-list.h>
+#include <libedataserver/e-source.h>
+#include <libedataserver/e-source-list.h>
+#include <camel/camel-url.h>
+  
 #include <libmapi/libmapi.h>
 
 
@@ -48,23 +53,23 @@
 
 #define d(x) x
 
-static 	GList *mapi_accounts = NULL;
-static	GSList *folders_list = NULL;
 struct _ExchangeAccountListenerPrivate {
 	GConfClient *gconf_client;
 	/* we get notification about mail account changes from this object */
-	EAccountList *account_list;                  
+	EAccountList *account_list;
 };
 
-/*stores some info about all currently existing mapi accounts 
-  list of ExchangeAccountInfo structures */
+typedef struct _ExchangeAccountInfo ExchangeAccountInfo;
+
+/* stores some info about all currently existing mapi accounts */
 struct _ExchangeAccountInfo {
 	char *uid;
 	char *name;
 	char *source_url;
 };
 
-typedef struct _ExchangeAccountInfo ExchangeAccountInfo;
+/* list of ExchangeAccountInfo structures */
+static 	GList *mapi_accounts = NULL;
 
 #define MAPI_URI_PREFIX   "mapi://" 
 #define MAPI_PREFIX_LENGTH 7
@@ -73,37 +78,6 @@
 
 static GObjectClass *parent_class = NULL;
 
-static void dispose (GObject *object);
-static void finalize (GObject *object);
-
-void
-exchange_account_listener_get_folder_list (void)
-{
-	if (folders_list)
-		return;
-
-	folders_list = exchange_mapi_peek_folder_list ();
-}
-
-static void 
-exchange_account_listener_class_init (ExchangeAccountListenerClass *class)
-{
-	GObjectClass *object_class;
-	
-	parent_class =  g_type_class_ref (PARENT_TYPE);
-	object_class = G_OBJECT_CLASS (class);
-	
-	/* virtual method override */
-	object_class->dispose = dispose;
-	object_class->finalize = finalize;
-}
-
-static void 
-exchange_account_listener_init (ExchangeAccountListener *config_listener,  ExchangeAccountListenerClass *class)
-{
-	config_listener->priv = g_new0 (ExchangeAccountListenerPrivate, 1);	
-}
-
 static void 
 dispose (GObject *object)
 {
@@ -143,13 +117,60 @@
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
+static void 
+exchange_account_listener_class_init (ExchangeAccountListenerClass *class)
+{
+	GObjectClass *object_class;
+	
+	parent_class =  g_type_class_ref (PARENT_TYPE);
+	object_class = G_OBJECT_CLASS (class);
+	
+	/* virtual method override */
+	object_class->dispose = dispose;
+	object_class->finalize = finalize;
+}
+
+static void 
+exchange_account_listener_init (ExchangeAccountListener *config_listener,  ExchangeAccountListenerClass *class)
+{
+	config_listener->priv = g_new0 (ExchangeAccountListenerPrivate, 1);
+}
+
+
+static	GSList *folders_list = NULL;
+
+GSList *
+exchange_account_listener_peek_folder_list (void)
+{
+	if (!folders_list)
+		folders_list = exchange_mapi_peek_folder_list ();
+	
+	return folders_list;
+}
+
+void
+exchange_account_listener_get_folder_list (void)
+{
+	if (folders_list)
+		return;
+
+	folders_list = exchange_mapi_peek_folder_list ();
+}
+
+void
+exchange_account_listener_free_folder_list (void)
+{
+	exchange_mapi_folder_list_free ();
+	folders_list = NULL;
+}
+
 /*determines whehter the passed in account is exchange or not by looking at source url */
 
 static gboolean
 is_mapi_account (EAccount *account)
 {
 	if (account->source->url != NULL) {
-		return (strncmp (account->source->url,  MAPI_URI_PREFIX, MAPI_PREFIX_LENGTH ) == 0);
+		return (strncmp (account->source->url, MAPI_URI_PREFIX, MAPI_PREFIX_LENGTH) == 0);
 	} else {
 		return FALSE;
 	}
@@ -161,15 +182,12 @@
 lookup_account_info (const char *key)
 {
 	GList *list;
-        ExchangeAccountInfo *info ;
+        ExchangeAccountInfo *info = NULL;
 	int found = 0;
-                                                                      
-        if (!key)
-                return NULL;
-
-	info = NULL;
+        
+	g_return_val_if_fail (key != NULL, NULL); 
 
-        for (list = g_list_first (mapi_accounts);  list;  list = g_list_next (list)) {
+        for (list = g_list_first (mapi_accounts); list; list = g_list_next (list)) {
                 info = (ExchangeAccountInfo *) (list->data);
                 found = (strcmp (info->uid, key) == 0);
 		if (found)
@@ -191,23 +209,6 @@
 
 #define ITIP_MESSAGE_HANDLING 	"/apps/evolution/itip/delete_processed"
 
-GSList *
-exchange_account_listener_peek_folder_list ()
-{
-	if (!folders_list)
-		folders_list = exchange_mapi_peek_folder_list ();
-	
-	return folders_list;
-}
-
-void
-exchange_account_listener_free_folder_list ()
-{
-	
-	exchange_mapi_folder_list_free ();
-	folders_list = NULL;
-}
-
 static void
 add_cal_esource (EAccount *account, GSList *folders, ExchangeMAPIFolderType folder_type, CamelURL *url)
 {
@@ -494,9 +495,8 @@
         ESourceGroup *group;
         ESource *source;
        	char *base_uri;
-	GSList *books_list, *temp_list;
+	GSList *temp_list;
 	GConfClient* client;
-	gboolean is_frequent_contacts = FALSE, is_writable = FALSE;
 
         url = camel_url_new (account->source->url, NULL);
 	if (url == NULL) {
@@ -648,9 +648,6 @@
 account_added (EAccountList *account_listener, EAccount *account)
 {
 	ExchangeAccountInfo *info;
-	EAccount *parent;
-	gboolean status;
-	CamelURL *parent_url;
 	
 	d(printf("account added\n"));
 	if (!is_mapi_account (account))
@@ -695,7 +692,7 @@
 	mapi_accounts = g_list_remove (mapi_accounts, info);
         url = camel_url_new (info->source_url, NULL);
 	if (url != NULL) {
-		char *profile = camel_url_get_param (url, "profile");
+		const char *profile = camel_url_get_param (url, "profile");
 		exchange_mapi_delete_profile (profile);
 		camel_url_free (url);
 	}
@@ -831,7 +828,7 @@
 			
 	}
 
-	printf ("\n\alistener is constructed \n\a");
+	printf ("MAPI listener is constructed \n");
 
 	g_signal_connect (config_listener->priv->account_list, "account_added", G_CALLBACK (account_added), NULL);
 	g_signal_connect (config_listener->priv->account_list, "account_changed", G_CALLBACK (account_changed), NULL);
@@ -841,7 +838,7 @@
 GType
 exchange_account_listener_get_type (void)
 {
-	static GType exchange_account_listener_type  = 0;
+	static GType exchange_account_listener_type = 0;
 
 	if (!exchange_account_listener_type) {
 		static GTypeInfo info = {

Modified: branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.h
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.h	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-account-listener.h	Wed Oct 22 04:10:18 2008
@@ -23,11 +23,9 @@
 #ifndef EXCHANGE_ACCOUNT_LISTENER_H
 #define EXCHANGE_ACCOUNT_LISTENER_H
 
-#include <libedataserver/e-account-list.h>
-#include <libedataserver/e-source.h>
-#include <libedataserver/e-source-list.h>
-#include <camel/camel-url.h>
-                         
+#include <glib.h>
+#include <glib-object.h>
+
 G_BEGIN_DECLS
 
 #define EXCHANGE_TYPE_ACCOUNT_LISTENER            (exchange_account_listener_get_type ())
@@ -39,20 +37,21 @@
 typedef struct _ExchangeAccountListener ExchangeAccountListener;
 typedef struct _ExchangeAccountListenerClass ExchangeAccountListenerClass;
 typedef struct _ExchangeAccountListenerPrivate ExchangeAccountListenerPrivate;
+
 struct _ExchangeAccountListener {
        GObject parent;
-                                                                                                                        
        ExchangeAccountListenerPrivate *priv;
 };
 
 struct _ExchangeAccountListenerClass {
-       GObjectClass parent_class;     
+       GObjectClass parent_class;
 };
 
-void 			exchange_account_listener_get_folder_list (void);
 GType                   exchange_account_listener_get_type (void);
 ExchangeAccountListener *exchange_account_listener_new (void);
-void                    exchange_account_listener_free_folder_list ();
+GSList 			*exchange_account_listener_peek_folder_list (void); 
+void 			exchange_account_listener_get_folder_list (void);
+void                    exchange_account_listener_free_folder_list (void);
 
 G_END_DECLS
 

Modified: branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.c
==============================================================================
--- branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.c	(original)
+++ branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.c	Wed Oct 22 04:10:18 2008
@@ -41,6 +41,7 @@
 #include <libmapi/libmapi.h>
 #include "mail/em-account-editor.h"
 #include "mail/em-config.h"
+#include "exchange-mapi-account-setup.h"
 #include "exchange-account-listener.h"
 #include <addressbook/gui/widgets/eab-config.h>
 #include <calendar/gui/e-cal-config.h>
@@ -50,6 +51,8 @@
 
 #define d(x) x
 
+int e_plugin_lib_enable (EPluginLib *ep, int enable);
+
 /* Account Setup */
 GtkWidget *org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData *data);
 gboolean org_gnome_exchange_mapi_check_options(EPlugin *epl, EConfigHookPageCheckData *data);
@@ -85,7 +88,8 @@
 int
 e_plugin_lib_enable (EPluginLib *ep, int enable)
 {
-	printf("Loading Exchange MAPI Plugin\n");
+	g_print ("Loading Exchange MAPI Plugin \n");
+
 	if (!config_listener) {
 		config_listener = exchange_account_listener_new ();	
 	 	g_atexit ( free_mapi_listener );
@@ -95,95 +99,86 @@
 }
 
 gboolean
-exchange_mapi_delete_profile (char *profile)
+exchange_mapi_delete_profile (const char *profile)
 {
 	enum MAPISTATUS	retval;
-	gchar *profname = NULL, *profpath = NULL;
+	gboolean result = FALSE; 
+	gchar *profpath = NULL;
 
-	exchange_mapi_connection_close ();
-
-	profpath = g_build_filename (g_getenv("HOME"), DEFAULT_PROF_PATH, NULL);
+	profpath = g_build_filename (g_get_home_dir(), DEFAULT_PROF_PATH, NULL);
 	if (!g_file_test (profpath, G_FILE_TEST_EXISTS)) {
-		g_warning ("No need to delete profile. DB itself is missing\n");
-		return TRUE;
+		g_warning ("No need to delete profile. DB itself is missing \n");
+		result = TRUE;
+		goto cleanup; 
 	}
 
-	if (MAPIInitialize(profpath) != MAPI_E_SUCCESS){
-		retval = GetLastError();
+	retval = MAPIInitialize(profpath); 
+	if (retval == MAPI_E_SESSION_LIMIT)
+	/* do nothing, the profile store is already initialized */
+		; 
+	else if (retval != MAPI_E_SUCCESS) {
 		mapi_errstr("MAPIInitialize", GetLastError());
-
-		if (retval == MAPI_E_SESSION_LIMIT)
-			d(printf("%s(%d):%s:%s \n", __FILE__, __LINE__, __PRETTY_FUNCTION__, "Unable to init profile store"));
-
-		g_free(profpath);
-		exchange_mapi_connection_close ();
-		return FALSE;
+		goto cleanup; 
 	}
 
-	g_free(profpath);
-
-	if ((retval = DeleteProfile(profile)) != MAPI_E_SUCCESS) {
-		mapi_errstr("DeleteProfile: Unable to delete: ", GetLastError());
-		exchange_mapi_connection_close ();
-		return FALSE;
+	retval = DeleteProfile(profile); 
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("DeleteProfile", GetLastError());
+		goto cleanup; 
 	}	
 
 	exchange_mapi_connection_close ();
+	result = TRUE; 
 
-	return TRUE;
+cleanup: 
+	g_free(profpath);
+
+	return result;
 }
 
 gboolean 
 exchange_mapi_create_profile(const char *username, const char *password, const char *domain, const char *server)
 {
 	enum MAPISTATUS	retval;
-	enum MAPISTATUS status;
-	gchar *workstation;
+	gboolean result = FALSE; 
+	const gchar *workstation = "localhost";
 	gchar *profname = NULL, *profpath = NULL;
 	struct mapi_session *session = NULL;
 
-	/* Drop Any previsous connection */
-	exchange_mapi_connection_close ();
 
-	d(printf("Create profile with %s %s (****) %s %s\n", username, password, domain, server));
-	workstation = "localhost";
-	profpath = g_build_filename (g_getenv("HOME"), DEFAULT_PROF_PATH, NULL);
-	if (!g_file_test (profpath, G_FILE_TEST_EXISTS)) {
-		/* Create MAPI Profile */
-		if (CreateProfileStore (profpath, LIBAMPI_LDIF_DIR) != MAPI_E_SUCCESS) {
-			g_warning ("Profile Database creation failed\n");
-			g_free (profpath);
-			return FALSE;
+	d(g_print ("Create profile with %s %s (****) %s %s\n", username, password, domain, server));
+
+	profpath = g_build_filename (g_get_home_dir(), DEFAULT_PROF_PATH, NULL);
+	profname = g_strdup_printf("%s %s", username, domain);
+
+	if (!g_file_test (profpath, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+		/* Create a ProfileStore */
+		retval = CreateProfileStore (profpath, LIBMAPI_LDIF_DIR); 
+		if (retval != MAPI_E_SUCCESS) {
+			mapi_errstr("CreateProfileStore", GetLastError());
+			goto cleanup; 
 		}
 	}
 
-	d(printf("profpath %s\n", profpath));
-	if (MAPIInitialize(profpath) != MAPI_E_SUCCESS){
-		status = GetLastError();
-		if (status == MAPI_E_SESSION_LIMIT){
-			d(printf("%s(%d):%s:%s \n", __FILE__, __LINE__, __PRETTY_FUNCTION__, "[exchange_mapi_plugin] Still connected"));
-			mapi_errstr("MAPIInitialize", GetLastError());
-		} else {
- 			g_free(profpath);
-  			return FALSE;
- 		}
+	retval = MAPIInitialize(profpath); 
+	if (retval == MAPI_E_SESSION_LIMIT)
+	/* do nothing, the profile store is already initialized */
+		mapi_errstr("MAPIInitialize", GetLastError()); 
+	else if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("MAPIInitialize", GetLastError());
+		goto cleanup; 
 	}
 
-	d(printf("[exchange_mapi_plugin] Profile creation\n"));
+	/* Delete any existing profiles with the same profilename */
+	retval = DeleteProfile(profname); 
+	/* don't bother to check error - it would be valid if we got an error */
 
-	profname = g_strdup_printf("%s %s", username, domain);
-	while(CreateProfile(profname, username, password, 0) == -1){
-		retval = GetLastError();
-		if(retval ==  MAPI_E_NO_ACCESS){
-			d(printf("The profile alderly exist !. Deleting it and will recreate\n"));
-			if (DeleteProfile(profname) == -1) {
-				retval = GetLastError();
-				mapi_errstr("[exchange_mapi_plugin] DeleteProfile() ", retval);
-				return FALSE;
-			}
-		}
+	retval = CreateProfile(profname, username, password, 0); 
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("CreateProfile", GetLastError());
+		goto cleanup; 
 	}
-	
+
 	mapi_profile_add_string_attr(profname, "binding", server);
 	mapi_profile_add_string_attr(profname, "workstation", workstation);
 	mapi_profile_add_string_attr(profname, "domain", domain);
@@ -193,63 +188,43 @@
 	mapi_profile_add_string_attr(profname, "language", "0x40c");
 	mapi_profile_add_string_attr(profname, "method", "0x409");
 	
-	
 	/* Login now */
-	d(printf("Logging into the server\n"));
-	if (MapiLogonProvider(&session, profname, NULL, PROVIDER_ID_NSPI) == -1){
-		retval = GetLastError();
-		mapi_errstr("[exchange_mapi_plugin] Error ", retval);
-		if (retval == MAPI_E_NETWORK_ERROR){
-			g_warning ("MAPI Login: Network error\n");
-			return FALSE;
-		}
-		if (retval == MAPI_E_LOGON_FAILED){
-			g_warning ("MAPI Login: LOGIN Failed\n");
-			return FALSE;
-		}
-		g_warning ("MAPI Login: Generic error\n");
-		return FALSE;
+	d(printf("Logging into the server \n"));
+	retval = MapiLogonProvider(&session, profname, NULL, PROVIDER_ID_NSPI); 
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("MapiLogonProvider", GetLastError());
+		goto cleanup; 
+	}
+	d(printf("Login succeeded: Yeh \n"));
+
+	retval = ProcessNetworkProfile(session, username, NULL, NULL); 
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("ProcessNetworkProfile", GetLastError());
+		goto cleanup; 
+	}
+
+	/* Set it as the default profile. Is this needed? */
+	retval = SetDefaultProfile(profname); 
+	if (retval != MAPI_E_SUCCESS) {
+		mapi_errstr("SetDefaultProfile", GetLastError());
+		goto cleanup; 
 	}
 
-
-	
-	d(printf("Login succeeded: Yeh\n"));
-	if (ProcessNetworkProfile(session, username, NULL, NULL) == -1){
-		retval = GetLastError();
-		mapi_errstr("[exchange_mapi_plugin] : ProcessNetworkProfile", retval);
-		if (retval != MAPI_E_SUCCESS && retval != 0x1){
-			mapi_errstr("[exchange_mapi_plugin] ProcessNetworkProfile() ", retval);
-			if (retval == MAPI_E_NOT_FOUND){
-				g_warning ("Bad user\n");
-			}
-			if (DeleteProfile(profname) == -1){
-				retval = GetLastError();
-				mapi_errstr("[exchange_mapi_plugin] DeleteProfile() ", retval);
-			}
-			return FALSE;
-		}
-	}
-	
-	if ((retval = SetDefaultProfile(profname)) != MAPI_E_SUCCESS){
-		mapi_errstr("[exchange_mapi_plugin] SetDefaultProfile() ", GetLastError());
-		return FALSE;
-	}
-	
 	/* Close the connection, so that we can login with what we created */
 	exchange_mapi_connection_close ();
-	g_free (profpath);
 
-	/*Initialize a global connection */
+	/* Initialize a global connection */
 	//FIXME: Dont get the password from profile
-	if (!exchange_mapi_connection_new(profname, NULL))
-			return FALSE;
+	if (exchange_mapi_connection_new (profname, password)) {
+		result = TRUE;
+		exchange_account_listener_get_folder_list ();
+	}
 
+cleanup: 
 	g_free (profname);
-
-	exchange_account_listener_get_folder_list ();
+	g_free (profpath);
 
 	return TRUE;
-  
 }
 
 static void
@@ -358,23 +333,20 @@
 	const char *source_url;
 	GtkWidget *hbox = NULL;
 
-	GtkWidget *label;
-	GtkWidget *domain_name;
-	GtkWidget *auth_button;
-	char *domain;
-
-	int row = 0;
-
 	target_account = (EMConfigTargetAccount *)data->config->target;
 	source_url = e_account_get_string(target_account->account, E_ACCOUNT_SOURCE_URL);
 	url = camel_url_new(source_url, NULL);
-	
+
 	if (url == NULL)
 		return NULL;
-	
+
 	if (!g_ascii_strcasecmp (url->protocol, "mapi")) {
 		d(printf("%s(%d):%s:Creating Widgets for MAPI Setup \n", __FILE__, __LINE__, __PRETTY_FUNCTION__);)
-		row = ((GtkTable *)data->parent)->nrows;		
+		GtkWidget *label;
+		GtkWidget *domain_name;
+		GtkWidget *auth_button;
+		const char *domain;
+		int row = ((GtkTable *)data->parent)->nrows;		
 
 		/* Domain name & Authenticate Button*/
 		hbox = gtk_hbox_new (FALSE, 6);
@@ -385,7 +357,7 @@
 		gtk_label_set_mnemonic_widget (GTK_LABEL (label), domain_name);
 		gtk_box_pack_start (GTK_BOX (hbox), domain_name, FALSE, FALSE, 0);
 		g_signal_connect (domain_name, "changed", G_CALLBACK(domain_entry_changed), data->config);
-		
+
 		auth_button = gtk_button_new_with_mnemonic (_("_Authenticate"));
 		gtk_box_pack_start (GTK_BOX (hbox), auth_button, FALSE, FALSE, 0);
 
@@ -429,7 +401,7 @@
 		
 		if (url)
 			camel_url_free(url);
-		
+
 	} else
 		return TRUE;
 	
@@ -449,7 +421,6 @@
 {
 	mapi_id_t fid;
 	gboolean status = FALSE;
-	GtkTreeIter parent;
 	
 	gtk_tree_model_get (GTK_TREE_MODEL (ts), iter, 1, &fid, -1);
 	if (fid && folder->parent_folder_id == fid) {
@@ -469,7 +440,7 @@
 	while (gtk_tree_model_iter_next (ts, iter) && !status) {
 		status = check_node (ts, folder, iter);
 	}
-	
+
 	return status;
 }
 
@@ -493,7 +464,6 @@
 	GSList *tmp = folders;
 	GtkTreeIter iter;
 	char *node = _("Personal Folders");
-	mapi_id_t last = 0;
 	
 	gtk_tree_store_append (ts, &iter, NULL);
 	gtk_tree_store_set (ts, &iter, 0, node, -1);
@@ -533,11 +503,8 @@
 	GtkCellRenderer *rcell;
 	GtkTreeStore *ts;
 	GtkTreeViewColumn *tvc;
-	GtkListStore *model;
-	char *acc;
+	const char *acc;
 	GSList *folders = exchange_account_listener_peek_folder_list ();
-	int type;
-	GtkWidget *parent;
 
 	uri_text = e_source_get_uri (source);
 	if (uri_text && g_ascii_strncasecmp (uri_text, "mapi", 4)) {
@@ -618,7 +585,8 @@
 {
 	EABConfigTargetSource *t = (EABConfigTargetSource *) target;
 	ESource *source = t->source;
-	char *uri_text, *sfid, *tmp;
+	char *uri_text, *tmp;
+	const char *sfid; 
 	mapi_id_t fid, pfid;
 	ESourceGroup *grp;
 	

Added: branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.h
==============================================================================
--- (empty file)
+++ branches/EXCHANGE_MAPI_BRANCH/plugins/exchange-mapi/exchange-mapi-account-setup.h	Wed Oct 22 04:10:18 2008
@@ -0,0 +1,29 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ *
+ * Authors:
+ *		Srinivasa Ragavan <sragavan novell com>
+ *		Johnny Jacob  <jjohnny novell com>
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+gboolean 
+exchange_mapi_create_profile(const char *username, const char *password, const char *domain, const char *server);
+
+gboolean
+exchange_mapi_delete_profile (const char *profile); 
+



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