[evolution] Adapt to CamelOperation API changes.



commit 41f0d7117eb958bd4a153c27e3cd0a58e14f4d75
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Nov 5 01:21:10 2011 -0400

    Adapt to CamelOperation API changes.

 mail/em-format-html.c             |    2 +-
 mail/em-utils.c                   |    4 +---
 mail/mail-mt.c                    |    4 ++--
 mail/mail-send-recv.c             |    2 +-
 mail/message-list.c               |   12 ++++--------
 plugins/pst-import/pst-importer.c |    3 +--
 6 files changed, 10 insertions(+), 17 deletions(-)
---
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index f3209b8..9a7c87f 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1614,7 +1614,7 @@ emfh_gethttp (struct _EMFormatHTMLJob *job,
 		costream = camel_data_cache_add (emfh_http_cache, EMFH_HTTP_CACHE_PATH, job->u.uri, NULL);
 
 	do {
-		if (camel_operation_cancel_check (CAMEL_OPERATION (cancellable))) {
+		if (g_cancellable_is_cancelled (cancellable)) {
 			n = -1;
 			break;
 		}
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 6797888..399e512 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -1458,7 +1458,7 @@ try_open_book_client (EBookClient *book_client,
 		E_CLIENT (book_client), only_if_exists,
 		cancellable, try_open_book_client_cb, &data);
 
-	while (canceled = camel_operation_cancel_check (NULL),
+	while (canceled = g_cancellable_is_cancelled (cancellable),
 			!canceled && !e_flag_is_set (flag)) {
 		GTimeVal wait;
 
@@ -1690,8 +1690,6 @@ search_address_in_addressbooks (const gchar *address,
 
 		mail_cancel_hook_remove (hook_stop);
 
-		stop = stop || camel_operation_cancel_check (NULL);
-
 		if (stop && !cached_book && book_client) {
 			g_object_unref (book_client);
 		} else if (!stop && book_client && !cached_book) {
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 0d05a21..526571f 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -283,7 +283,7 @@ mail_msg_cancel (guint msgid)
 	g_mutex_unlock (mail_msg_lock);
 
 	if (cancellable != NULL) {
-		camel_operation_cancel (CAMEL_OPERATION (cancellable));
+		g_cancellable_cancel (cancellable);
 		g_object_unref (cancellable);
 	}
 }
@@ -340,7 +340,7 @@ mail_cancel_hook_remove (GHook *hook)
 void
 mail_cancel_all (void)
 {
-	camel_operation_cancel (NULL);
+	camel_operation_cancel_all ();
 
 	g_mutex_lock (mail_msg_lock);
 
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 33ac977..167b4fd 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -191,7 +191,7 @@ receive_cancel (GtkButton *button,
                 struct _send_info *info)
 {
 	if (info->state == SEND_ACTIVE) {
-		camel_operation_cancel (CAMEL_OPERATION (info->cancellable));
+		g_cancellable_cancel (info->cancellable);
 		if (info->status_label)
 			gtk_label_set_text (
 				GTK_LABEL (info->status_label),
diff --git a/mail/message-list.c b/mail/message-list.c
index 1e903a3..e01f42f 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4999,20 +4999,16 @@ mail_regen_cancel (MessageList *ml)
 {
 	/* cancel any outstanding regeneration requests, not we don't clear, they clear themselves */
 	if (ml->regen) {
-		GList *l;
+		GList *link;
 
 		g_mutex_lock (ml->regen_lock);
 
-		l = ml->regen;
-		while (l) {
-			MailMsg *mm = l->data;
+		for (link = ml->regen; link != NULL; link = link->next) {
+			MailMsg *mm = link->data;
 			GCancellable *cancellable;
 
 			cancellable = e_activity_get_cancellable (mm->activity);
-			if (CAMEL_IS_OPERATION (cancellable))
-				camel_operation_cancel (
-					CAMEL_OPERATION (cancellable));
-			l = l->next;
+			g_cancellable_cancel (cancellable);
 		}
 
 		g_mutex_unlock (ml->regen_lock);
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c
index 7ef82d4..d4054b5 100644
--- a/plugins/pst-import/pst-importer.c
+++ b/plugins/pst-import/pst-importer.c
@@ -798,7 +798,6 @@ static void
 pst_import_folders (PstImporter *m,
                     pst_desc_tree *topitem)
 {
-	CamelOperation *co = CAMEL_OPERATION (m->cancellable);
 	GHashTable *node_to_folderuri; /* pointers of hierarchy nodes, to them associated folder uris */
 	pst_desc_tree *d_ptr;
 
@@ -809,7 +808,7 @@ pst_import_folders (PstImporter *m,
 		g_hash_table_insert (node_to_folderuri, topitem, g_strdup (m->folder_uri));
 
 	/* Walk through folder tree */
-	while (d_ptr != NULL && (camel_operation_cancel_check (co) == FALSE)) {
+	while (d_ptr != NULL && (g_cancellable_is_cancelled (m->cancellable) == FALSE)) {
 		gchar *previous_folder = NULL;
 
 		m->position++;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]