From 35340abb72120c3b7ef27d9e9bde361471c78236 Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Mon, 1 Aug 2005 06:46:30 +0000 Subject: Added new (add_defaults_for_account) : Added a call to the newly added 2005-08-01 Praveen Kumar * exchnage-config-listener.c (exchange_add_autocompletion_folders) : Added new (add_defaults_for_account) : Added a call to the newly added function to select GAL for autocompletion by default. Fixes bug 303998 svn path=/trunk/; revision=29945 --- plugins/exchange-operations/ChangeLog | 6 +++ .../exchange-operations/exchange-config-listener.c | 50 ++++++++++++++++++++-- 2 files changed, 53 insertions(+), 3 deletions(-) (limited to 'plugins/exchange-operations') diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index c5a09144dc..5548357cec 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,9 @@ +2005-08-01 Praveen Kumar + * exchnage-config-listener.c + (exchange_add_autocompletion_folders) : Added new + (add_defaults_for_account) : Added a call to the newly added function + to select GAL for autocompletion by default. Fixes bug 303998 + 2005-07-27 Praveen Kumar * exchange-folder.c (org_gnome_exchange_folder_subscription) : Handle diff --git a/plugins/exchange-operations/exchange-config-listener.c b/plugins/exchange-operations/exchange-config-listener.c index 2138e9d638..5b4cb2a86c 100644 --- a/plugins/exchange-operations/exchange-config-listener.c +++ b/plugins/exchange-operations/exchange-config-listener.c @@ -86,6 +86,9 @@ static void account_changed (EAccountList *account_listener, static void account_removed (EAccountList *account_listener, EAccount *account); +static void exchange_add_autocompletion_folders (GConfClient *gc_client, + ExchangeAccount *account); + static void class_init (GObjectClass *object_class) { @@ -202,9 +205,7 @@ add_defaults_for_account (ExchangeConfigListener *config_listener, { EAccount *eaccount; -#if LDEAD - add_autocompletion_folders (config_listener->priv->gconf, account); -#endif + exchange_add_autocompletion_folders (config_listener->priv->gconf, account); eaccount = config_listener->priv->configured_account; set_special_mail_folder (account, "drafts", @@ -879,3 +880,46 @@ exchange_config_listener_get_accounts (ExchangeConfigListener *config_listener) return NULL; } +/** + * exchange_add_autocompletion_folders: + * + * @gc_client: GConfClient handle + * @account: ExchangeAccount handle + * + * This function adds the GAL of the Exchange account to the autocompletion list + * while configuring a new Exchange account + * + **/ +static void +exchange_add_autocompletion_folders (GConfClient *gc_client, ExchangeAccount *account) +{ + ESourceList *sl=NULL; + ESourceGroup *group; + ESource *source; + GSList *groups, *sources; + gboolean found_group=FALSE; + + sl = e_source_list_new_for_gconf (gc_client, CONF_KEY_CONTACTS); + groups = e_source_list_peek_groups (sl); + + for ( ; groups != NULL && !found_group; groups = g_slist_next (groups)) { + group = E_SOURCE_GROUP (groups->data); + if (strcmp (e_source_group_peek_name (group), account->account_name) == 0 + && + strcmp (e_source_group_peek_base_uri (group), EXCHANGE_URI_PREFIX) == 0) { + + sources = e_source_group_peek_sources (group); + + for( ; sources != NULL; sources = g_slist_next (sources)) { + source = E_SOURCE (sources->data); + if (g_str_has_prefix (e_source_peek_absolute_uri (source), + "gal://")) { + /* Set autocompletion on GAL alone by default */ + e_source_set_property (source, "completion", "true"); + break; + } + } + found_group = TRUE; + } + } +} -- cgit v1.2.3