From e63cb34cd7a25fda9ca0d945997440a3ac023938 Mon Sep 17 00:00:00 2001 From: Parthasarathi Susarla Date: Thu, 10 Feb 2005 10:51:58 +0000 Subject: [PATCH] fixed the percentage display problem while fetching summary fixed the 2005-02-10 Parthasarathi Susarla * camel-groupwise-store.c: (groupwise_get_folder): fixed the percentage display problem while fetching summary * camel-groupwise-folder.c: (groupwise_expunge): fixed the problem with deleting mails using removeItemRequest instead of removeItemsrequest --- camel/providers/groupwise/ChangeLog | 9 +++++ camel/providers/groupwise/camel-groupwise-folder.c | 43 ++++++++++------------ camel/providers/groupwise/camel-groupwise-store.c | 11 +++--- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/camel/providers/groupwise/ChangeLog b/camel/providers/groupwise/ChangeLog index 5cbdf02..18b015d 100644 --- a/camel/providers/groupwise/ChangeLog +++ b/camel/providers/groupwise/ChangeLog @@ -1,3 +1,12 @@ +2005-02-10 Parthasarathi Susarla + + * camel-groupwise-store.c: + (groupwise_get_folder): fixed the percentage display problem + while fetching summary + * camel-groupwise-folder.c: + (groupwise_expunge): fixed the problem with deleting mails + using removeItemRequest instead of removeItemsrequest + 2005-02-09 Vivek Jain * camel-groupwise-store.c: diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c index 97292f1..4bb3bca 100644 --- a/camel/providers/groupwise/camel-groupwise-folder.c +++ b/camel/providers/groupwise/camel-groupwise-folder.c @@ -42,6 +42,7 @@ #include "camel-private.h" #include "camel-groupwise-private.h" #include "camel-groupwise-journal.h" +#include "camel-groupwise-utils.h" #include "camel-stream-mem.h" #include #include @@ -477,12 +478,12 @@ static void groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) { CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store) ; - //CamelGroupwiseStorePrivate *priv = gw_store->priv ; + CamelGroupwiseStorePrivate *priv = gw_store->priv ; CamelMessageInfo *info ; CamelGroupwiseMessageInfo *gw_info ; GList *items = NULL ; flags_diff_t diff ; - //EGwConnection *cnc = cnc_lookup (priv) ; + EGwConnection *cnc = cnc_lookup (priv) ; int count, i ; g_print ("groupwise sync\n") ; if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) @@ -512,6 +513,9 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) /* if (items) e_gw_connection_mark_read (cnc, items) ;*/ + + if (expunge) + e_gw_connection_purge_deleted_items (cnc) ; camel_folder_summary_save (folder->summary); @@ -729,10 +733,8 @@ gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex) } temp_date = e_gw_item_get_creation_date(item) ; - if (temp_date) { - date = e_gw_connection_format_date_string(temp_date) ; - mi->info.date_sent = mi->info.date_received = e_gw_connection_get_date_from_string (date) ; - } + if (temp_date) + mi->info.date_sent = mi->info.date_received = e_gw_connection_get_date_from_string (temp_date) ; mi->info.uid = g_strdup (e_gw_item_get_id (item)) ; mi->info.subject = g_strdup (e_gw_item_get_subject(item)) ; @@ -935,8 +937,8 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex) EGwConnection *cnc; EGwConnectionStatus status ; CamelFolderChangeInfo *changes ; - GList *l, *n, *item_ids = NULL; int i, max; + gboolean delete = FALSE ; CAMEL_SERVICE_LOCK (groupwise_store, connect_lock); @@ -944,30 +946,25 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex) cnc = cnc_lookup (priv) ; + container_id = g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->name)) ; + max = camel_folder_summary_count (folder->summary); for (i = 0; i < max; i++) { info = camel_folder_summary_index (folder->summary, i); ginfo = (CamelGroupwiseMessageInfo *) info; if (ginfo->info.flags & CAMEL_MESSAGE_DELETED) { - item_ids = g_list_append (item_ids, g_strdup (camel_message_info_uid (info))); - camel_folder_change_info_remove_uid (changes, (char *) item_ids->data); + const char *uid = camel_message_info_uid (info) ; + status = e_gw_connection_remove_item (cnc, container_id, uid); + if (status == E_GW_CONNECTION_STATUS_OK) { + camel_folder_change_info_remove_uid (changes, (char *) uid); + delete = TRUE ; + } } camel_message_info_free (info); } - - container_id = g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->name)) ; - status = e_gw_connection_remove_items (cnc, container_id, item_ids); - if (status == E_GW_CONNECTION_STATUS_OK) - camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); - else - g_print ("ERROR!!! Could not delete items\n") ; - - l = item_ids; - while (l != NULL) { - n = l->next; - g_list_free_1 (l); - l = n; - } + + if (delete) + camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes) ; CAMEL_SERVICE_UNLOCK (groupwise_store, connect_lock); diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c index 70caaf5..5644bee 100644 --- a/camel/providers/groupwise/camel-groupwise-store.c +++ b/camel/providers/groupwise/camel-groupwise-store.c @@ -487,7 +487,6 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags, gboolean done = FALSE ; int count = 0, cursor, summary_count = 0 ; - storage_path = g_strdup_printf ("%s/folders", priv->storage_path); folder_dir = e_path_to_physical (storage_path, folder_name); g_free (storage_path); @@ -619,9 +618,9 @@ groupwise_get_folder (CamelStore *store, const char *folder_name, guint32 flags, if (temp == count) camel_operation_progress (NULL, 0) ; if (temp < count) - camel_operation_progress (NULL, temp * 100/count) ; + camel_operation_progress (NULL, 100 - (temp * 100/count)) ; if (temp >count) - camel_operation_progress (NULL, count * 100/temp) ; + camel_operation_progress (NULL, 100 - (count * 100/temp)) ; if (!list || temp == 0) done = TRUE; g_list_free (list); @@ -752,7 +751,7 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca const char *url, *top_folder, *temp_url ; char *temp_str = NULL, *folder_real = NULL ; CamelFolderInfo *info = NULL ; - + CAMEL_SERVICE_LOCK (store, connect_lock) ; if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) { @@ -840,8 +839,8 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca if (type == E_GW_CONTAINER_TYPE_INBOX) fi->flags |= CAMEL_FOLDER_TYPE_INBOX; - if (type == E_GW_CONTAINER_TYPE_TRASH) - fi->flags |= CAMEL_FOLDER_TYPE_TRASH ; +/* if (type == E_GW_CONTAINER_TYPE_TRASH) + fi->flags |= CAMEL_FOLDER_TYPE_TRASH ;*/ if ( (type == E_GW_CONTAINER_TYPE_INBOX) || (type == E_GW_CONTAINER_TYPE_OUTBOX) || -- 2.7.4