diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-07-08 23:04:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-09-28 23:35:55 +0800 |
commit | a91eeb647138ee035444cdc3c265fa4e95898f29 (patch) | |
tree | 63b5712bc407630d6ad6e504244e6cc4ebc35a86 /plugins | |
parent | 2c21832faab43a176dcb37bc2c65e9e3fb55fc9f (diff) | |
download | gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.tar gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.tar.gz gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.tar.bz2 gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.tar.lz gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.tar.xz gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.tar.zst gsoc2013-evolution-a91eeb647138ee035444cdc3c265fa4e95898f29.zip |
Pass GCancellable to Camel.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/dbx-import/dbx-importer.c | 10 | ||||
-rw-r--r-- | plugins/groupwise-features/install-shared.c | 8 | ||||
-rw-r--r-- | plugins/groupwise-features/share-folder-common.c | 9 | ||||
-rw-r--r-- | plugins/groupwise-features/status-track.c | 4 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 21 | ||||
-rw-r--r-- | plugins/mail-to-task/mail-to-task.c | 5 | ||||
-rw-r--r-- | plugins/mark-all-read/mark-all-read.c | 12 | ||||
-rw-r--r-- | plugins/prefer-plain/prefer-plain.c | 28 | ||||
-rw-r--r-- | plugins/pst-import/pst-importer.c | 25 | ||||
-rw-r--r-- | plugins/templates/templates.c | 10 | ||||
-rw-r--r-- | plugins/tnef-attachments/tnef-plugin.c | 15 |
11 files changed, 107 insertions, 40 deletions
diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index 9905b617b7..fd3825762c 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -552,7 +552,9 @@ dbx_import_file (DbxImporter *m) m->parent_uri = g_strdup (((EImportTargetURI *)m->target)->uri_dest); /* Destination folder, was set in our widget */ camel_operation_start (NULL, _("Importing '%s'"), filename); - folder = mail_tool_uri_to_folder (m->parent_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error); + folder = mail_tool_uri_to_folder ( + m->parent_uri, CAMEL_STORE_FOLDER_CREATE, + m->base.cancellable, &m->base.error); if (!folder) return; d(printf("importing to %s\n", camel_folder_get_full_name(folder))); @@ -623,7 +625,8 @@ dbx_import_file (DbxImporter *m) info = camel_message_info_new (NULL); camel_message_info_set_flags (info, flags, ~0); success = camel_folder_append_message ( - folder, msg, info, NULL, &m->base.error); + folder, msg, info, NULL, + m->base.cancellable, &m->base.error); camel_message_info_free (info); g_object_unref (msg); @@ -637,7 +640,8 @@ dbx_import_file (DbxImporter *m) close (m->dbx_fd); if (m->indices) g_free (m->indices); - camel_folder_sync (folder, FALSE, NULL); + /* FIXME Not passing GCancellable or GError here. */ + camel_folder_sync (folder, FALSE, NULL, NULL); camel_folder_thaw (folder); g_object_unref (folder); if (missing && m->base.error == NULL) { diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 2db4eaf4e7..b753653229 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -103,12 +103,16 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { - folder = camel_store_get_folder (store, "Mailbox", 0, NULL); + /* FIXME Not passing a GCancellable or GError here. */ + folder = camel_store_get_folder (store, "Mailbox", 0, NULL, NULL); /*changes = camel_folder_change_info_new (); camel_folder_change_info_remove_uid (changes, (gchar *) item_id); camel_folder_summary_remove_uid (folder->summary, item_id);*/ /* camel_folder_delete_message (folder, item_id); */ - camel_folder_set_message_flags (folder, item_id, CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); + camel_folder_set_message_flags ( + folder, item_id, + CAMEL_MESSAGE_DELETED, + CAMEL_MESSAGE_DELETED); camel_folder_summary_touch (folder->summary); /* camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); */ uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL); diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 1b6fb180ea..9a345f1ba6 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -142,9 +142,14 @@ create_folder_exec (struct _EMCreateFolder *m) { d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name)); - if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &m->base.error))) { + if ((m->fi = camel_store_create_folder ( + m->store, m->parent, m->name, + m->base.cancellable, &m->base.error))) { + if (camel_store_supports_subscriptions (m->store)) - camel_store_subscribe_folder (m->store, m->full_name, &m->base.error); + camel_store_subscribe_folder ( + m->store, m->full_name, + m->base.cancellable, &m->base.error); } } diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c index 2ff2764a12..61c1ac25f0 100644 --- a/plugins/groupwise-features/status-track.c +++ b/plugins/groupwise-features/status-track.c @@ -73,7 +73,9 @@ get_selected_message (EShellView *shell_view, *folder = e_mail_reader_get_folder (reader); *selected_uid = g_strdup (g_ptr_array_index (uids, 0)); - msg = camel_folder_get_message (*folder, *selected_uid, NULL); + /* FIXME Not passing a GCancellable or GError here. */ + msg = camel_folder_get_message ( + *folder, *selected_uid, NULL, NULL); } em_utils_uids_free (uids); diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index f0ca0fd807..15fdf6f9e1 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -132,7 +132,7 @@ struct _itip_puri { void format_itip (EPlugin *ep, EMFormatHookTarget *target); GtkWidget *itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data); -static void itip_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri); +static void itip_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri, GCancellable *cancellable); gint e_plugin_lib_enable (EPlugin *ep, gint enable); typedef struct { @@ -2025,9 +2025,8 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) } } - if (!save_schedules && pitip->delete_message) { + if (!save_schedules && pitip->delete_message) camel_folder_delete_message (pitip->folder, pitip->uid); - } if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) { ECalComponent *comp = NULL; @@ -2097,7 +2096,10 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) e_cal_component_rescan (comp); if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE, FALSE)) { - camel_folder_set_message_flags (pitip->folder, pitip->uid, CAMEL_MESSAGE_ANSWERED, CAMEL_MESSAGE_ANSWERED); + camel_folder_set_message_flags ( + pitip->folder, pitip->uid, + CAMEL_MESSAGE_ANSWERED, + CAMEL_MESSAGE_ANSWERED); } g_object_unref (comp); @@ -2748,12 +2750,17 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) } static void -itip_attachment_frame (EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) +itip_attachment_frame (EMFormat *emf, + CamelStream *stream, + EMFormatPURI *puri, + GCancellable *cancellable) { struct _itip_puri *info = (struct _itip_puri *)puri; - d(printf("writing to frame content, handler is '%s'\n", info->handle->mime_type)); - info->handle->handler (emf, stream, info->puri.part, info->handle, FALSE); + info->handle->handler ( + emf, stream, info->puri.part, + info->handle, cancellable, FALSE); + camel_stream_close (stream, NULL); } diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 86663cc3b5..88d9d09e3a 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -780,7 +780,10 @@ do_mail_to_event (AsyncData *data) struct _manage_comp *mc; /* retrieve the message from the CamelFolder */ - message = camel_folder_get_message (folder, g_ptr_array_index (uids, i), NULL); + /* FIXME Not passing a GCancellable or GError. */ + message = camel_folder_get_message ( + folder, g_ptr_array_index (uids, i), + NULL, NULL); if (!message) { continue; } diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c index 5649bd8661..10d0eae5e9 100644 --- a/plugins/mark-all-read/mark-all-read.c +++ b/plugins/mark-all-read/mark-all-read.c @@ -348,18 +348,20 @@ mark_all_as_read (CamelFolder *folder) static gboolean mar_all_sub_folders (CamelStore *store, CamelFolderInfo *fi, + GCancellable *cancellable, GError **error) { while (fi) { CamelFolder *folder; if (fi->child) { - if (!mar_all_sub_folders (store, fi->child, error)) + if (!mar_all_sub_folders ( + store, fi->child, cancellable, error)) return FALSE; } folder = camel_store_get_folder ( - store, fi->full_name, 0, error); + store, fi->full_name, 0, cancellable, error); if (folder == NULL) return FALSE; @@ -389,10 +391,11 @@ mar_got_folder (gchar *folder_uri, full_name = camel_folder_get_full_name (folder); parent_store = camel_folder_get_parent_store (folder); + /* FIXME Not passing a GCancellable or GError here. */ folder_info = camel_store_get_folder_info ( parent_store, full_name, CAMEL_STORE_FOLDER_INFO_RECURSIVE | - CAMEL_STORE_FOLDER_INFO_FAST, NULL); + CAMEL_STORE_FOLDER_INFO_FAST, NULL, NULL); if (folder_info == NULL) goto exit; @@ -405,7 +408,8 @@ mar_got_folder (gchar *folder_uri, if (response == MARK_ALL_READ_CURRENT_FOLDER) mark_all_as_read (folder); else if (response == MARK_ALL_READ_WITH_SUBFOLDERS) - mar_all_sub_folders (parent_store, folder_info, NULL); + /* FIXME Not passing a GCancellable or GError here. */ + mar_all_sub_folders (parent_store, folder_info, NULL, NULL); exit: camel_store_free_folder_info (parent_store, folder_info); diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 630b5e3ab4..f82a217f9a 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -66,9 +66,13 @@ make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part g_free (str); } - em_format_part_as (format, stream, part, "application/octet-stream"); + /* FIXME Not passing a GCancellable here. */ + em_format_part_as ( + format, stream, part, + "application/octet-stream", NULL); } else - em_format_part (format, stream, part); + /* FIXME Not passing a GCancellable here. */ + em_format_part (format, stream, part, NULL); g_string_truncate (format->part_id, partidlen); } @@ -80,7 +84,10 @@ org_gnome_prefer_plain_text_html (gpointer ep, EMFormatHookTarget *t) if (epp_mode != EPP_TEXT || strstr (t->format->part_id->str, ".alternative-prefer-plain.") != NULL || em_format_is_inline (t->format, t->format->part_id->str, t->part, &(t->item->handler))) - t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE); + /* FIXME Not passing a GCancellable here. */ + t->item->handler.old->handler ( + t->format, t->stream, t->part, + t->item->handler.old, NULL, FALSE); else if (epp_show_suppressed) make_part_attachment (t->format, t->stream, t->part, -1); } @@ -155,10 +162,16 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t if (display_part && have_plain && nparts == 2) { g_string_append_printf (t->format->part_id, ".alternative-prefer-plain.%d", displayid); - em_format_part_as (t->format, t->stream, display_part, "text/html"); + /* FIXME Not passing a GCancellable here. */ + em_format_part_as ( + t->format, t->stream, + display_part, "text/html", NULL); g_string_truncate (t->format->part_id, partidlen); } else { - t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE); + /* FIXME Not passing a GCancellable here. */ + t->item->handler.old->handler ( + t->format, t->stream, t->part, + t->item->handler.old, NULL, FALSE); } return; } else if (!CAMEL_IS_MULTIPART (mp)) { @@ -179,7 +192,10 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t /* if we found a text part, show it */ if (display_part) { g_string_append_printf(t->format->part_id, ".alternative-prefer-plain.%d", displayid); - em_format_part_as(t->format, t->stream, display_part, "text/plain"); + /* FIXME Not passing a GCancellable here. */ + em_format_part_as ( + t->format, t->stream, + display_part, "text/plain", NULL); g_string_truncate (t->format->part_id, partidlen); } diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 6455ff42f7..7bd0138618 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -251,7 +251,8 @@ get_suggested_foldername (EImportTargetURI *target) g_string_append (foldername, "outlook_data"); } - if (mail_tool_uri_to_folder (foldername->str, 0, NULL) != NULL) { + /* FIXME Not passing a GCancellable or GError here. */ + if (mail_tool_uri_to_folder (foldername->str, 0, NULL, NULL) != NULL) { CamelFolder *folder; /* Folder exists - add a number */ @@ -261,7 +262,8 @@ get_suggested_foldername (EImportTargetURI *target) for (i=1; i<10000; i++) { g_string_truncate (foldername, len); g_string_append_printf (foldername, "_%d", i); - if ((folder=mail_tool_uri_to_folder (foldername->str, 0, NULL)) == NULL) { + /* FIXME Not passing a GCancellable or GError here. */ + if ((folder=mail_tool_uri_to_folder (foldername->str, 0, NULL, NULL)) == NULL) { /* Folder does not exist */ break; } @@ -452,7 +454,9 @@ pst_import_file (PstImporter *m) camel_operation_start (NULL, _("Importing '%s'"), filename); if (GPOINTER_TO_INT (g_datalist_get_data (&m->target->data, "pst-do-mail"))) { - mail_tool_uri_to_folder (m->parent_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error); + mail_tool_uri_to_folder ( + m->parent_uri, CAMEL_STORE_FOLDER_CREATE, + m->base.cancellable, &m->base.error); } ret = pst_init (&m->pst, filename); @@ -703,7 +707,9 @@ pst_create_folder (PstImporter *m) *pos = '\0'; - folder = mail_tool_uri_to_folder (dest, CAMEL_STORE_FOLDER_CREATE, &m->base.error); + folder = mail_tool_uri_to_folder ( + dest, CAMEL_STORE_FOLDER_CREATE, + m->base.cancellable, &m->base.error); g_object_unref (folder); *pos = '/'; } @@ -715,8 +721,9 @@ pst_create_folder (PstImporter *m) g_object_unref (m->folder); } - m->folder = mail_tool_uri_to_folder (m->folder_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error); - + m->folder = mail_tool_uri_to_folder ( + m->folder_uri, CAMEL_STORE_FOLDER_CREATE, + m->base.cancellable, &m->base.error); } /** @@ -916,12 +923,14 @@ pst_process_email (PstImporter *m, pst_item *item) if (item->flags & 0x08) camel_message_info_set_flags (info, CAMEL_MESSAGE_DRAFT, ~0); + /* FIXME Not passing a GCancellable or GError here. */ success = camel_folder_append_message ( - m->folder, msg, info, NULL, NULL); + m->folder, msg, info, NULL, NULL, NULL); camel_message_info_free (info); g_object_unref (msg); - camel_folder_sync (m->folder, FALSE, NULL); + /* FIXME Not passing a GCancellable or GError here. */ + camel_folder_sync (m->folder, FALSE, NULL, NULL); camel_folder_thaw (m->folder); if (!success) { diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 6b0857875e..83dd985402 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -565,8 +565,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager, gchar *path; guint ii; + /* FIXME Not passing a GCancellable or GError here. */ folder = camel_store_get_folder ( - store, folder_info->full_name, 0, NULL); + store, folder_info->full_name, 0, NULL, NULL); folder_name = camel_folder_get_name (folder); action_name = g_strdup_printf ( @@ -612,7 +613,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager, if (flags & CAMEL_MESSAGE_DELETED) continue; - template = camel_folder_get_message (folder, uid, NULL); + /* FIXME Not passing a GCancellable or GError here. */ + template = camel_folder_get_message ( + folder, uid, NULL, NULL); g_object_ref (template); action_label = @@ -764,10 +767,11 @@ update_actions_cb (EShellView *shell_view) templates_folder = e_mail_local_get_folder (E_MAIL_FOLDER_TEMPLATES); full_name = camel_folder_get_full_name (templates_folder); + /* FIXME Not passing a GCancellable or GError here. */ folder_info = camel_store_get_folder_info ( store, full_name, CAMEL_STORE_FOLDER_INFO_RECURSIVE | - CAMEL_STORE_FOLDER_INFO_FAST, NULL); + CAMEL_STORE_FOLDER_INFO_FAST, NULL, NULL); build_template_menus_recurse ( ui_manager, action_group, diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index 03577a4667..648c48a856 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -165,9 +165,15 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) g_string_append_printf(t->format->part_id, ".tnef"); if (camel_multipart_get_number (mp) > 0) - em_format_part_as(t->format, t->stream, mainpart, "multipart/mixed"); + /* FIXME Not passing a GCancellable here. */ + em_format_part_as ( + t->format, t->stream, mainpart, + "multipart/mixed", NULL); else if (t->item->handler.old) - t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE); + /* FIXME Not passing a GCancellable here. */ + t->item->handler.old->handler ( + t->format, t->stream, t->part, + t->item->handler.old, NULL, FALSE); g_string_truncate (t->format->part_id, len); @@ -177,7 +183,10 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) goto ok; fail: if (t->item->handler.old) - t->item->handler.old->handler (t->format, t->stream, t->part, t->item->handler.old, FALSE); + /* FIXME Not passing a GCancellable here. */ + t->item->handler.old->handler ( + t->format, t->stream, t->part, + t->item->handler.old, NULL, FALSE); ok: g_free (name); g_free (tmpdir); |