aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-config-listener.c
diff options
context:
space:
mode:
authorPraveen Kumar <kpraveen@novell.com>2005-07-22 15:48:16 +0800
committerPraveen Kumar <kpraveen@src.gnome.org>2005-07-22 15:48:16 +0800
commit94b079846d701f72043a651d9df2efa90aa6a2d7 (patch)
tree90c33c3cffc7e14e467d070bd8615c7a907b6632 /plugins/exchange-operations/exchange-config-listener.c
parentf29491124b132b0baf7582f482f749c018661717 (diff)
downloadgsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.tar
gsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.tar.gz
gsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.tar.bz2
gsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.tar.lz
gsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.tar.xz
gsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.tar.zst
gsoc2013-evolution-94b079846d701f72043a651d9df2efa90aa6a2d7.zip
Handling the rename of calendars. This addresses the bug 310433 Removed
2005-07-22 Praveen Kumar <kpraveen@novell.com> * exchange-calendar.c : Handling the rename of calendars. This addresses the bug 310433 * exchange-config-listener.c : Removed the functions add_folder_esource and remove_folder_esource * exchange-contacts.c : Handling the rename of addressbooks. Also modified the way of Exchange addressbook ESource URI handling to be the same way as calendar ESource URI handling * exchange-operations.c (exchange_operations_update_child_esources) : Added new to handle the rename of the ESources of all child folders in the case of parent folder being renamed. * exchange-operations.h : Added prototype for the new function svn path=/trunk/; revision=29842
Diffstat (limited to 'plugins/exchange-operations/exchange-config-listener.c')
-rw-r--r--plugins/exchange-operations/exchange-config-listener.c262
1 files changed, 0 insertions, 262 deletions
diff --git a/plugins/exchange-operations/exchange-config-listener.c b/plugins/exchange-operations/exchange-config-listener.c
index 41134c0887..2138e9d638 100644
--- a/plugins/exchange-operations/exchange-config-listener.c
+++ b/plugins/exchange-operations/exchange-config-listener.c
@@ -355,145 +355,6 @@ done:
g_object_unref (client);
}
-void
-add_folder_esource (ExchangeAccount *account,
- FolderType folder_type,
- const char *folder_name,
- const char *physical_uri)
-{
- ESource *source = NULL;
- ESourceGroup *source_group = NULL;
- char *relative_uri = NULL, *username = NULL;
- GSList *ids;
- GConfClient *client;
- gboolean is_contacts_folder = TRUE, group_new = FALSE, source_new = FALSE;
- const char *offline = NULL;
- int mode;
- ESourceList *source_list = NULL;
-
- client = gconf_client_get_default ();
-
- username = exchange_account_get_username (account);
-
- if (folder_type == EXCHANGE_CONTACTS_FOLDER) {
- source_list = e_source_list_new_for_gconf ( client,
- CONF_KEY_CONTACTS);
- }
- else if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
- source_list = e_source_list_new_for_gconf ( client,
- CONF_KEY_CAL);
- relative_uri = g_strdup (physical_uri + strlen (EXCHANGE_URI_PREFIX));
- is_contacts_folder = FALSE;
- }
- else if (folder_type == EXCHANGE_TASKS_FOLDER) {
- source_list = e_source_list_new_for_gconf ( client,
- CONF_KEY_TASKS);
- relative_uri = g_strdup (physical_uri + strlen (EXCHANGE_URI_PREFIX));
- is_contacts_folder = FALSE;
- }
-
- exchange_account_is_offline_sync_set (account, &mode);
-
- if ((source_group = e_source_list_peek_group_by_name (source_list,
- account->account_name)) == NULL) {
- source_group = e_source_group_new (account->account_name,
- EXCHANGE_URI_PREFIX);
- if (!e_source_list_add_group (source_list, source_group, -1)) {
- g_object_unref (source_list);
- g_object_unref (source_group);
- g_object_unref (client);
- g_free (relative_uri);
- return;
- }
- if (is_contacts_folder)
- source = e_source_new_with_absolute_uri (folder_name,
- physical_uri);
- else
- source = e_source_new (folder_name, relative_uri);
-
- if (mode == OFFLINE_MODE) {
- /* If account is marked for offline sync during account
- * creation, mark all the folders for offline sync
- */
- e_source_set_property (source, "offline_sync", "1");
- }
- if (username)
- e_source_set_property (source, "username", username);
- e_source_group_add_source (source_group, source, -1);
- e_source_list_sync (source_list, NULL);
- group_new = source_new = TRUE;
- }
- else {
- /* source group already exists*/
- if((source = e_source_group_peek_source_by_name (source_group,
- folder_name)) == NULL) {
- printf("old group, new source\n");
- if (is_contacts_folder)
- source = e_source_new_with_absolute_uri (
- folder_name, physical_uri);
- else
- source = e_source_new (folder_name, relative_uri);
-
- if (mode == OFFLINE_MODE)
- e_source_set_property (source, "offline_sync", "1");
- if (username)
- e_source_set_property (source, "username", username);
-
- e_source_group_add_source (source_group, source, -1);
- source_new = TRUE;
- e_source_list_sync (source_list, NULL);
- } else {
- /* source group and source both already exist */
- offline = e_source_get_property (source, "offline_sync");
- if (!offline) {
- /* Folder doesn't have any offline property set */
- if (mode == OFFLINE_MODE)
- e_source_set_property (source, "offline_sync", "1");
- }
- }
- }
-
- if (source && !is_contacts_folder) {
-
- /* Select the folder created */
- if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
- ids = gconf_client_get_list (client,
- CONF_KEY_SELECTED_CAL_SOURCES,
- GCONF_VALUE_STRING, NULL);
- ids = g_slist_append (ids,
- g_strdup (e_source_peek_uid (source)));
- gconf_client_set_list (client,
- CONF_KEY_SELECTED_CAL_SOURCES,
- GCONF_VALUE_STRING, ids, NULL);
- g_slist_foreach (ids, (GFunc) g_free, NULL);
- g_slist_free (ids);
- }
- else if (folder_type == EXCHANGE_TASKS_FOLDER) {
-
- ids = gconf_client_get_list (client,
- CONF_KEY_SELECTED_TASKS_SOURCES,
- GCONF_VALUE_STRING, NULL);
-
- ids = g_slist_append (ids,
- g_strdup (e_source_peek_uid (source)));
- gconf_client_set_list (client,
- CONF_KEY_SELECTED_TASKS_SOURCES,
- GCONF_VALUE_STRING, ids, NULL);
- g_slist_foreach (ids, (GFunc) g_free, NULL);
- g_slist_free (ids);
- }
- }
-
- g_free (relative_uri);
-
- if (source_new)
- g_object_unref (source);
- if (group_new)
- g_object_unref (source_group);
- g_object_unref (source_list);
- g_object_unref (client);
-}
-
static void
add_new_sources (ExchangeAccount *account)
{
@@ -695,129 +556,6 @@ remove_account_esource (ExchangeAccount *account,
g_object_unref (client);
}
-void
-remove_folder_esource (ExchangeAccount *account,
- FolderType folder_type,
- const char *physical_uri)
-{
- ESourceGroup *group;
- ESource *source;
- GSList *groups;
- GSList *sources;
- gboolean found_group, is_contacts_folder = TRUE;
- char *relative_uri = NULL;
- const char *source_uid;
- GSList *ids, *temp_ids, *node_to_be_deleted;
- GConfClient *client;
- ESourceList *source_list = NULL;
-
- client = gconf_client_get_default ();
-
- /* Remove ESource for a given folder */
- if (folder_type == EXCHANGE_CONTACTS_FOLDER) {
- source_list = e_source_list_new_for_gconf ( client,
- CONF_KEY_CONTACTS);
- }
- else if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
- source_list = e_source_list_new_for_gconf ( client,
- CONF_KEY_CAL);
- relative_uri = g_strdup (physical_uri + strlen (EXCHANGE_URI_PREFIX));
- is_contacts_folder = FALSE;
- }
- else if (folder_type == EXCHANGE_TASKS_FOLDER) {
- source_list = e_source_list_new_for_gconf ( client,
- CONF_KEY_TASKS);
- relative_uri = g_strdup (physical_uri + strlen (EXCHANGE_URI_PREFIX));
- is_contacts_folder = FALSE;
- }
-
- groups = e_source_list_peek_groups (source_list);
- found_group = FALSE;
-
- 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 (((!is_contacts_folder &&
- strcmp (e_source_peek_relative_uri (source),
- relative_uri) == 0)) ||
- (is_contacts_folder &&
- strcmp (e_source_peek_absolute_uri (source),
- physical_uri) == 0)) {
-
- source_uid = e_source_peek_uid (source);
- /* Folder Deleted - Remove only the source */
- /*
- e_source_group_remove_source_by_uid (
- group,
- source_uid);
- */
- e_source_group_remove_source (
- group,
- source);
- e_source_list_sync (source_list, NULL);
- if (!is_contacts_folder) {
- /* Remove from the selected folders */
- if (folder_type == EXCHANGE_CALENDAR_FOLDER) {
- ids = gconf_client_get_list (
- client,
- CONF_KEY_SELECTED_CAL_SOURCES,
- GCONF_VALUE_STRING, NULL);
- if (ids) {
- node_to_be_deleted = g_slist_find_custom (ids,
- source_uid,
- (GCompareFunc) strcmp);
- if (node_to_be_deleted) {
- g_free (node_to_be_deleted->data);
- ids = g_slist_delete_link (ids,
- node_to_be_deleted);
- }
- }
- temp_ids = ids;
- for (; temp_ids != NULL; temp_ids = g_slist_next (temp_ids))
- g_free (temp_ids->data);
- g_slist_free (ids);
- }
- else if (folder_type == EXCHANGE_TASKS_FOLDER) {
- ids = gconf_client_get_list (client,
- CONF_KEY_SELECTED_TASKS_SOURCES,
- GCONF_VALUE_STRING, NULL);
- if (ids) {
- node_to_be_deleted = g_slist_find_custom (ids,
- source_uid,
- (GCompareFunc) strcmp);
- if (node_to_be_deleted) {
- g_free (node_to_be_deleted->data);
- ids = g_slist_delete_link (ids,
- node_to_be_deleted);
- }
- }
- temp_ids = ids;
- for (; temp_ids != NULL; temp_ids = g_slist_next (temp_ids))
- g_free (temp_ids->data);
- g_slist_free (ids);
- }
- }
- found_group = TRUE;
- break;
- }
- }
- }
- }
- g_object_unref (source_list);
- g_free (relative_uri);
- g_object_unref (client);
-}
-
static void
remove_account_esources (ExchangeAccount *account)
{