diff options
-rw-r--r-- | addressbook/gui/widgets/eab-contact-formatter.c | 13 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 8 | ||||
-rw-r--r-- | e-util/e-file-request.c | 15 | ||||
-rw-r--r-- | e-util/e-file-utils.c | 2 | ||||
-rw-r--r-- | e-util/e-stock-request.c | 15 | ||||
-rw-r--r-- | em-format/em-format.c | 15 | ||||
-rw-r--r-- | libemail-engine/e-mail-folder-utils.c | 14 | ||||
-rw-r--r-- | libemail-engine/e-mail-session-utils.c | 8 | ||||
-rw-r--r-- | libemail-engine/e-mail-session.c | 6 | ||||
-rw-r--r-- | libemail-engine/e-mail-store-utils.c | 8 | ||||
-rw-r--r-- | mail/e-http-request.c | 15 | ||||
-rw-r--r-- | mail/e-mail-request.c | 15 | ||||
-rw-r--r-- | modules/composer-autosave/e-autosave-utils.c | 4 |
13 files changed, 107 insertions, 31 deletions
diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c index 57ce415d35..c436ea8e12 100644 --- a/addressbook/gui/widgets/eab-contact-formatter.c +++ b/addressbook/gui/widgets/eab-contact-formatter.c @@ -1237,7 +1237,7 @@ eab_contact_formatter_format_contact_async (EABContactFormatter *formatter, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GSimpleAsyncResult *simple; g_return_if_fail (EAB_IS_CONTACT_FORMATTER (formatter)); g_return_if_fail (E_IS_CONTACT (contact)); @@ -1249,13 +1249,14 @@ eab_contact_formatter_format_contact_async (EABContactFormatter *formatter, formatter->priv->contact = contact; - result = g_simple_async_result_new ( - G_OBJECT (formatter), - callback, user_data, - eab_contact_formatter_format_contact_async); + simple = g_simple_async_result_new ( + G_OBJECT (formatter), callback, user_data, + eab_contact_formatter_format_contact_async); + + g_simple_async_result_set_check_cancellable (simple, cancellable); g_simple_async_result_run_in_thread ( - result, do_start_async_formatter, + simple, do_start_async_formatter, G_PRIORITY_DEFAULT, cancellable); } diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index f033e9dd52..50c51b60bc 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1081,6 +1081,8 @@ composer_build_message (EMsgComposer *composer, G_OBJECT (composer), callback, user_data, composer_build_message); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -4574,6 +4576,8 @@ e_msg_composer_get_message (EMsgComposer *composer, G_OBJECT (composer), callback, user_data, e_msg_composer_get_message); + g_simple_async_result_set_check_cancellable (simple, cancellable); + if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer))) flags |= COMPOSER_FLAG_HTML_CONTENT; @@ -4649,6 +4653,8 @@ e_msg_composer_get_message_print (EMsgComposer *composer, G_OBJECT (composer), callback, user_data, e_msg_composer_get_message_print); + g_simple_async_result_set_check_cancellable (simple, cancellable); + flags |= COMPOSER_FLAG_HTML_CONTENT; flags |= COMPOSER_FLAG_SAVE_OBJECT_DATA; @@ -4698,6 +4704,8 @@ e_msg_composer_get_message_draft (EMsgComposer *composer, G_OBJECT (composer), callback, user_data, e_msg_composer_get_message_draft); + g_simple_async_result_set_check_cancellable (simple, cancellable); + if (gtkhtml_editor_get_html_mode (GTKHTML_EDITOR (composer))) flags |= COMPOSER_FLAG_HTML_CONTENT; diff --git a/e-util/e-file-request.c b/e-util/e-file-request.c index 62c64e34a8..08d8682261 100644 --- a/e-util/e-file-request.c +++ b/e-util/e-file-request.c @@ -93,7 +93,7 @@ file_request_send_async (SoupRequest *request, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GSimpleAsyncResult *simple; d(printf("received request for %s\n", soup_uri_to_string (uri, FALSE))); @@ -102,10 +102,15 @@ file_request_send_async (SoupRequest *request, * which WebKit thinks it's remote, but in fact it behaves like * oridnary file:// */ - result = g_simple_async_result_new (G_OBJECT (request), callback, - user_data, file_request_send_async); - g_simple_async_result_run_in_thread (result, handle_file_request, - G_PRIORITY_DEFAULT, cancellable); + simple = g_simple_async_result_new ( + G_OBJECT (request), callback, user_data, + file_request_send_async); + + g_simple_async_result_set_check_cancellable (simple, cancellable); + + g_simple_async_result_run_in_thread ( + simple, handle_file_request, + G_PRIORITY_DEFAULT, cancellable); } static GInputStream * diff --git a/e-util/e-file-utils.c b/e-util/e-file-utils.c index ebb65f460e..90b2e77205 100644 --- a/e-util/e-file-utils.c +++ b/e-util/e-file-utils.c @@ -172,6 +172,8 @@ e_file_replace_contents_async (GFile *file, G_OBJECT (file), callback, user_data, e_file_replace_contents_async); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); diff --git a/e-util/e-stock-request.c b/e-util/e-stock-request.c index 2b805f471e..c9a2e5fc1b 100644 --- a/e-util/e-stock-request.c +++ b/e-util/e-stock-request.c @@ -180,14 +180,19 @@ stock_request_send_async (SoupRequest *request, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GSimpleAsyncResult *simple; d(printf("received request for %s\n", soup_uri_to_string (uri, FALSE))); - result = g_simple_async_result_new (G_OBJECT (request), callback, - user_data, stock_request_send_async); - g_simple_async_result_run_in_thread (result, handle_stock_request, - G_PRIORITY_DEFAULT, cancellable); + simple = g_simple_async_result_new ( + G_OBJECT (request), callback, user_data, + stock_request_send_async); + + g_simple_async_result_set_check_cancellable (simple, cancellable); + + g_simple_async_result_run_in_thread ( + simple, handle_stock_request, + G_PRIORITY_DEFAULT, cancellable); } static GInputStream * diff --git a/em-format/em-format.c b/em-format/em-format.c index 6b08705d86..23b2fd6ba8 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -1996,7 +1996,7 @@ em_format_parse_async (EMFormat *emf, GAsyncReadyCallback callback, gpointer user_data) { - GSimpleAsyncResult *result; + GSimpleAsyncResult *simple; g_return_if_fail (EM_IS_FORMAT (emf)); @@ -2023,10 +2023,15 @@ em_format_parse_async (EMFormat *emf, } - result = g_simple_async_result_new (G_OBJECT (emf), callback, - user_data, em_format_parse_async); - g_simple_async_result_run_in_thread (result, emf_start_async_parser, - G_PRIORITY_DEFAULT, cancellable); + simple = g_simple_async_result_new ( + G_OBJECT (emf), callback, + user_data, em_format_parse_async); + + g_simple_async_result_set_check_cancellable (simple, cancellable); + + g_simple_async_result_run_in_thread ( + simple, emf_start_async_parser, + G_PRIORITY_DEFAULT, cancellable); } void diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c index ddf2bcf54d..6d2f3f499f 100644 --- a/libemail-engine/e-mail-folder-utils.c +++ b/libemail-engine/e-mail-folder-utils.c @@ -147,6 +147,8 @@ e_mail_folder_append_message (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_append_message); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -301,6 +303,8 @@ e_mail_folder_build_attachment (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_build_attachment); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -558,6 +562,8 @@ e_mail_folder_find_duplicate_messages (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_find_duplicate_messages); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -686,6 +692,8 @@ e_mail_folder_get_multiple_messages (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_get_multiple_messages); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -916,6 +924,8 @@ e_mail_folder_remove (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_remove); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_run_in_thread ( simple, mail_folder_remove_thread, io_priority, cancellable); @@ -1127,6 +1137,8 @@ e_mail_folder_remove_attachments (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_remove_attachments); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -1377,6 +1389,8 @@ e_mail_folder_save_messages (CamelFolder *folder, G_OBJECT (folder), callback, user_data, e_mail_folder_save_messages); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c index 81ad83ed9b..403ba57ae9 100644 --- a/libemail-engine/e-mail-session-utils.c +++ b/libemail-engine/e-mail-session-utils.c @@ -205,6 +205,8 @@ e_mail_session_handle_draft_headers (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_handle_draft_headers); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -356,6 +358,8 @@ e_mail_session_handle_source_headers (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_handle_source_headers); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -819,6 +823,8 @@ e_mail_session_send_to (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_send_to); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -927,6 +933,8 @@ e_mail_session_unsubscribe_folder (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_unsubscribe_folder); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c index 0b1625f7c9..475f8024aa 100644 --- a/libemail-engine/e-mail-session.c +++ b/libemail-engine/e-mail-session.c @@ -1738,6 +1738,8 @@ e_mail_session_get_inbox (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_get_inbox); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -1835,6 +1837,8 @@ e_mail_session_get_trash (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_get_trash); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -1948,6 +1952,8 @@ e_mail_session_uri_to_folder (EMailSession *session, G_OBJECT (session), callback, user_data, e_mail_session_uri_to_folder); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); diff --git a/libemail-engine/e-mail-store-utils.c b/libemail-engine/e-mail-store-utils.c index 2f5b044426..9719c0d353 100644 --- a/libemail-engine/e-mail-store-utils.c +++ b/libemail-engine/e-mail-store-utils.c @@ -122,6 +122,8 @@ e_mail_store_create_folder (CamelStore *store, G_OBJECT (store), callback, user_data, e_mail_store_create_folder); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) async_context_free); @@ -216,6 +218,8 @@ e_mail_store_go_offline (CamelStore *store, G_OBJECT (store), callback, user_data, e_mail_store_go_offline); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_run_in_thread ( simple, (GSimpleAsyncThreadFunc) mail_store_go_offline_thread, @@ -291,6 +295,8 @@ e_mail_store_go_online (CamelStore *store, G_OBJECT (store), callback, user_data, e_mail_store_go_online); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_run_in_thread ( simple, (GSimpleAsyncThreadFunc) mail_store_go_online_thread, @@ -364,6 +370,8 @@ e_mail_store_prepare_for_offline (CamelStore *store, G_OBJECT (store), callback, user_data, e_mail_store_prepare_for_offline); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_run_in_thread ( simple, (GSimpleAsyncThreadFunc) mail_store_prepare_for_offline_thread, diff --git a/mail/e-http-request.c b/mail/e-http-request.c index a8417efb95..edf13152df 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -430,7 +430,7 @@ http_request_send_async (SoupRequest *request, gpointer user_data) { EHTTPRequest *ehr; - GSimpleAsyncResult *result; + GSimpleAsyncResult *simple; gchar *mail_uri; SoupURI *uri; const gchar *enc; @@ -464,10 +464,15 @@ http_request_send_async (SoupRequest *request, /* Make sure the formatter lives until we are finished here */ g_object_ref (ehr->priv->efh); - result = g_simple_async_result_new (G_OBJECT (request), callback, - user_data, http_request_send_async); - g_simple_async_result_run_in_thread (result, handle_http_request, - G_PRIORITY_DEFAULT, cancellable); + simple = g_simple_async_result_new ( + G_OBJECT (request), callback, + user_data, http_request_send_async); + + g_simple_async_result_set_check_cancellable (simple, cancellable); + + g_simple_async_result_run_in_thread ( + simple, handle_http_request, + G_PRIORITY_DEFAULT, cancellable); g_hash_table_destroy (query); } diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c index 8a51b2a226..d36e0cba2e 100644 --- a/mail/e-mail-request.c +++ b/mail/e-mail-request.c @@ -180,7 +180,7 @@ mail_request_send_async (SoupRequest *request, { SoupSession *session; EMailRequest *emr = E_MAIL_REQUEST (request); - GSimpleAsyncResult *result; + GSimpleAsyncResult *simple; SoupURI *uri; GHashTable *formatters; gchar *uri_str; @@ -209,10 +209,15 @@ mail_request_send_async (SoupRequest *request, /* Make sure the formatter lives until we are finished here */ g_object_ref (emr->priv->efh); - result = g_simple_async_result_new (G_OBJECT (request), callback, - user_data, mail_request_send_async); - g_simple_async_result_run_in_thread (result, handle_mail_request, - G_PRIORITY_DEFAULT, cancellable); + simple = g_simple_async_result_new ( + G_OBJECT (request), callback, + user_data, mail_request_send_async); + + g_simple_async_result_set_check_cancellable (simple, cancellable); + + g_simple_async_result_run_in_thread ( + simple, handle_mail_request, + G_PRIORITY_DEFAULT, cancellable); } static GInputStream * diff --git a/modules/composer-autosave/e-autosave-utils.c b/modules/composer-autosave/e-autosave-utils.c index 8d03aaaecc..88f6dde0e8 100644 --- a/modules/composer-autosave/e-autosave-utils.c +++ b/modules/composer-autosave/e-autosave-utils.c @@ -410,6 +410,8 @@ e_composer_load_snapshot (EShell *shell, G_OBJECT (shell), callback, user_data, e_composer_load_snapshot); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) load_context_free); @@ -464,6 +466,8 @@ e_composer_save_snapshot (EMsgComposer *composer, G_OBJECT (composer), callback, user_data, e_composer_save_snapshot); + g_simple_async_result_set_check_cancellable (simple, cancellable); + g_simple_async_result_set_op_res_gpointer ( simple, context, (GDestroyNotify) save_context_free); |