diff options
author | Sarfraaz Ahmed <asarfraaz@novell.com> | 2005-07-05 17:19:10 +0800 |
---|---|---|
committer | Ahmed Sarfraaz <sarfraaz@src.gnome.org> | 2005-07-05 17:19:10 +0800 |
commit | 3fd1fe0a663ea89de54fc40fd157c5047d0c0d63 (patch) | |
tree | 2bb886ec4c81449fe56228aecf1b811c6bd61f8c /plugins/exchange-operations | |
parent | 342d3c32efc78ba037046d32b137321b915bac6d (diff) | |
download | gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.tar gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.tar.gz gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.tar.bz2 gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.tar.lz gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.tar.xz gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.tar.zst gsoc2013-evolution-3fd1fe0a663ea89de54fc40fd157c5047d0c0d63.zip |
Newly added. This adds the esources for all the folders only if the
2005-07-05 Sarfraaz Ahmed <asarfraaz@novell.com>
* exchange-config-listener.c (add_new_sources) : Newly added. This adds
the esources for all the folders only if the esource doesnt already
exist.
(account_added) : Invoke add_new_sources after connect.
svn path=/trunk/; revision=29638
Diffstat (limited to 'plugins/exchange-operations')
-rw-r--r-- | plugins/exchange-operations/ChangeLog | 7 | ||||
-rw-r--r-- | plugins/exchange-operations/exchange-config-listener.c | 55 |
2 files changed, 62 insertions, 0 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index 154d3d4595..18f31c6d33 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,10 @@ +2005-07-05 Sarfraaz Ahmed <asarfraaz@novell.com> + + * exchange-config-listener.c (add_new_sources) : Newly added. This adds + the esources for all the folders only if the esource doesnt already + exist. + (account_added) : Invoke add_new_sources after connect. + 2005-07-01 Praveen Kumar <kpraveen@novell.com> * Makefile.am : Added new file entries for calendar , contacts diff --git a/plugins/exchange-operations/exchange-config-listener.c b/plugins/exchange-operations/exchange-config-listener.c index 6808931624..7991a7d956 100644 --- a/plugins/exchange-operations/exchange-config-listener.c +++ b/plugins/exchange-operations/exchange-config-listener.c @@ -30,6 +30,7 @@ #include <exchange-account.h> #include <exchange-constants.h> +#include <exchange-hierarchy.h> #include <e-folder-exchange.h> #include <e2k-marshal.h> #include <e2k-uri.h> @@ -494,6 +495,59 @@ add_folder_esource (ExchangeAccount *account, } static void +add_new_sources (ExchangeAccount *account) +{ + GPtrArray *exchange_folders; + + exchange_folders = exchange_account_get_folders (account); + if (exchange_folders && exchange_folders->len > 0) { + int i; + const char *folder_type; + const char *folder_name; + const char *folder_uri; + int type; + EFolder *folder; + ExchangeHierarchy *hier; + gboolean create_esource = FALSE; + + for (i = 0; i < exchange_folders->len; i++) { + + folder = exchange_folders->pdata[i]; + hier = e_folder_exchange_get_hierarchy (folder); + if (hier->type != EXCHANGE_HIERARCHY_PUBLIC) { + folder_name = e_folder_get_name (folder); + folder_uri = e_folder_get_physical_uri (folder); + folder_type = e_folder_get_type_string (folder); + + if (!(strcmp (folder_type, "calendar")) || + !(strcmp (folder_type, "calendar/public"))) { + type = EXCHANGE_CALENDAR_FOLDER; + create_esource = TRUE; + } + else if (!(strcmp (folder_type, "tasks")) || + !(strcmp (folder_type, "tasks/public"))) { + type = EXCHANGE_TASKS_FOLDER; + create_esource = TRUE; + } + else if (!(strcmp (folder_type, "contacts")) || + !(strcmp (folder_type, "contacts/public")) || + !(strcmp (folder_type, "contacts/ldap"))) { + type = EXCHANGE_CONTACTS_FOLDER; + create_esource = TRUE; + } + else { + create_esource = FALSE; + } + + if (create_esource) + add_folder_esource (account, type, + folder_name, folder_uri); + } /* End hierarchy type check */ + } /* End for loop */ + } /* End check for a list of folders */ +} + +static void add_sources (ExchangeAccount *account) { GPtrArray *exchange_folders; @@ -819,6 +873,7 @@ account_added (EAccountList *account_list, EAccount *account) exchange_account); add_sources (exchange_account); exchange_account_connect (exchange_account); + add_new_sources (exchange_account); } struct account_update_data { |