[evolution-ews] Camel start using move items operation new API
- From: Pavel Ocheretny <pocheretny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Camel start using move items operation new API
- Date: Wed, 4 May 2011 19:07:15 +0000 (UTC)
commit adab9610171da79d7f54c2ef1f6e9e814abfbfd1
Author: Pavel Ocheretny <pocheretny git gnome org>
Date: Wed May 4 22:06:33 2011 +0300
Camel start using move items operation new API
src/camel/camel-ews-folder.c | 18 +++++++++---------
src/camel/camel-ews-folder.h | 1 +
2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index 22fc2c5..bf3ec5c 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -1050,7 +1050,6 @@ ews_transfer_messages_to_sync (CamelFolder *source,
GError *rerror = NULL;
GSList *ids = NULL, *ret_items = NULL;
gint i = 0;
- EVO2(GCancellable *cancellable = NULL);
dst_full_name = camel_folder_get_full_name (destination);
dst_ews_store = (CamelEwsStore *) camel_folder_get_parent_store (destination);
@@ -1067,10 +1066,9 @@ ews_transfer_messages_to_sync (CamelFolder *source,
ids = g_slist_append(ids, (gchar *)uids->pdata[i]);
}
- if (e_ews_connection_move_items (cnc, EWS_PRIORITY_MEDIUM,
- dst_id, !delete_originals,
- ids, &ret_items,
- cancellable, &rerror)) {
+ ret_items = e_ews_move_items_operation_sync (cnc, dst_id, !delete_originals,ids, &rerror);
+
+ if (ret_items) {
if (delete_originals) {
changes = camel_folder_change_info_new ();
for (i=0; i < uids->len; i++) {
@@ -1085,13 +1083,15 @@ ews_transfer_messages_to_sync (CamelFolder *source,
ews_refresh_info_sync (source, EVO3(cancellable,) NULL);
ews_refresh_info_sync (destination, EVO3(cancellable,) NULL);
}
+ else {
+ if (rerror)
+ g_propagate_error (error, rerror);
+ }
+
g_free (dst_id);
-
- if (rerror)
- g_propagate_error (error, rerror);
-
g_object_unref (cnc);
g_slist_free (ids);
+ g_slist_foreach (ret_items, (GFunc) e_ews_free_id, NULL);
g_slist_free (ret_items);
return !rerror;
diff --git a/src/camel/camel-ews-folder.h b/src/camel/camel-ews-folder.h
index b4d1a4d..a8906ff 100644
--- a/src/camel/camel-ews-folder.h
+++ b/src/camel/camel-ews-folder.h
@@ -30,6 +30,7 @@
#include <camel/camel.h>
#include "camel-ews-summary.h"
+#include <e-ews-move-items-operation.h>
/* Standard GObject macros */
#define CAMEL_TYPE_EWS_FOLDER \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]