[evolution-ews] Collect differences between original calendar item and modified calendar item atatchments
- From: Or Goshen <ogosh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] Collect differences between original calendar item and modified calendar item atatchments
- Date: Sun, 19 Jun 2011 14:01:45 +0000 (UTC)
commit 51018fff047ccf0df2e69c3a524bb1bbae37d7a2
Author: Or Goshen <orx goshen intel com>
Date: Sun Jun 19 17:13:57 2011 +0300
Collect differences between original calendar item and modified calendar item atatchments
src/calendar/e-cal-backend-ews-utils.c | 26 ++++++++++++++++++++++++++
src/calendar/e-cal-backend-ews-utils.h | 1 +
2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews-utils.c b/src/calendar/e-cal-backend-ews-utils.c
index 3cd6e1a..9e1f57d 100644
--- a/src/calendar/e-cal-backend-ews-utils.c
+++ b/src/calendar/e-cal-backend-ews-utils.c
@@ -471,3 +471,29 @@ void ewscal_set_reccurence_exceptions (ESoapMessage *msg, icalcomponent *comp)
e_soap_message_end_element (msg); /* "DeletedOccurrences" */
}
+
+void ewscal_get_attach_differences (const GSList *original, const GSList *modified, GSList **removed, GSList **added)
+{
+ gboolean flag;
+ GSList *i, *i_next, *j, *j_next, *original_copy, *modified_copy;
+ original_copy = g_slist_copy ((GSList *)original);
+ modified_copy = g_slist_copy ((GSList *)modified);
+
+ for (j = modified_copy; j; j = j_next) {
+ j_next = j->next;
+
+ for (i = original_copy, flag = FALSE; !flag && i; i = i_next) {
+ i_next = i->next;
+
+ if (g_strcmp0 (j->data, i->data) == 0) {
+ /* Remove from the lists attachments that are on both */
+ original_copy = g_slist_delete_link (original_copy, i);
+ modified_copy = g_slist_delete_link (modified_copy, j);
+ flag = TRUE;
+ }
+ }
+ }
+
+ *removed = original_copy;
+ *added = modified_copy;
+}
diff --git a/src/calendar/e-cal-backend-ews-utils.h b/src/calendar/e-cal-backend-ews-utils.h
index e8d85d4..47b227f 100644
--- a/src/calendar/e-cal-backend-ews-utils.h
+++ b/src/calendar/e-cal-backend-ews-utils.h
@@ -35,6 +35,7 @@ void ewscal_set_time (ESoapMessage *msg, const gchar *name, icaltimetype *t);
void ewscal_set_timezone (ESoapMessage *msg, const gchar *name, icaltimezone *icaltz);
void ewscal_set_reccurence (ESoapMessage *msg, icalproperty *rrule, icaltimetype *dtstart);
void ewscal_set_reccurence_exceptions (ESoapMessage *msg, icalcomponent *comp);
+void ewscal_get_attach_differences (const GSList *original, const GSList *modified, GSList **removed, GSList **added);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]