diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-12-01 10:53:20 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-02-20 23:04:25 +0800 |
commit | 23f5773903d64a554d977ae7d0ebbaca73528f1f (patch) | |
tree | 104e1a59da8bf96b004bce204b79f47bbe0a6d13 /libemail-engine | |
parent | 49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff) | |
download | gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.bz2 gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.lz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.xz gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'libemail-engine')
-rw-r--r-- | libemail-engine/e-mail-folder-utils.c | 10 | ||||
-rw-r--r-- | libemail-engine/e-mail-session-utils.c | 9 | ||||
-rw-r--r-- | libemail-engine/e-mail-utils.c | 19 | ||||
-rw-r--r-- | libemail-engine/mail-config.c | 24 | ||||
-rw-r--r-- | libemail-engine/mail-folder-cache.c | 13 | ||||
-rw-r--r-- | libemail-engine/mail-ops.c | 42 |
6 files changed, 80 insertions, 37 deletions
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c index 0e8c5b56c3..ddf2bcf54d 100644 --- a/libemail-engine/e-mail-folder-utils.c +++ b/libemail-engine/e-mail-folder-utils.c @@ -361,9 +361,9 @@ mail_folder_find_duplicate_messages_thread (GSimpleAsyncResult *simple, static GHashTable * emfu_get_messages_hash_sync (CamelFolder *folder, - GPtrArray *message_uids, - GCancellable *cancellable, - GError **error) + GPtrArray *message_uids, + GCancellable *cancellable, + GError **error) { GHashTable *hash_table; CamelMimeMessage *message; @@ -877,7 +877,9 @@ e_mail_folder_remove_sync (CamelFolder *folder, if (cancellable) { transparent_cancellable = g_cancellable_new (); - cbid = g_cancellable_connect (cancellable, G_CALLBACK (follow_cancel_cb), transparent_cancellable, NULL); + cbid = g_cancellable_connect ( + cancellable, G_CALLBACK (follow_cancel_cb), + transparent_cancellable, NULL); } success = mail_folder_remove_recursive ( diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c index 979d15388e..6aa090e0e4 100644 --- a/libemail-engine/e-mail-session-utils.c +++ b/libemail-engine/e-mail-session-utils.c @@ -392,6 +392,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, { AsyncContext *context; CamelFolder *local_sent_folder; + CamelServiceConnectionStatus status; GString *error_messages; gboolean copy_to_sent = TRUE; guint ii; @@ -417,11 +418,15 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, return; } - if (camel_service_get_connection_status (service) != CAMEL_SERVICE_CONNECTED) { + status = camel_service_get_connection_status (service); + if (status != CAMEL_SERVICE_CONNECTED) { did_connect = TRUE; /* XXX This API does not allow for cancellation. */ - if (!em_utils_connect_service_sync (service, cancellable, &error)) { + em_utils_connect_service_sync ( + service, cancellable, &error); + + if (error != NULL) { g_simple_async_result_take_error (simple, error); return; } diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c index 246a4e1329..af861ca98c 100644 --- a/libemail-engine/e-mail-utils.c +++ b/libemail-engine/e-mail-utils.c @@ -452,13 +452,15 @@ search_address_in_addressbooks (const gchar *address, const gchar *completion = e_source_get_property (source, "completion"); if (completion && g_ascii_strcasecmp (completion, "true") == 0) { - addr_sources = g_slist_prepend (addr_sources, g_object_ref (source)); + addr_sources = g_slist_prepend ( + addr_sources, g_object_ref (source)); } } } cancellable = g_cancellable_new (); - hook_cancellable = mail_cancel_hook_add (emu_addr_cancel_cancellable, cancellable); + hook_cancellable = mail_cancel_hook_add ( + emu_addr_cancel_cancellable, cancellable); for (s = addr_sources; !stop && !found && s; s = g_slist_next (s)) { ESource *source = s->data; @@ -536,10 +538,15 @@ search_address_in_addressbooks (const gchar *address, cached_book = TRUE; } - if (book_client && !stop && e_book_client_get_contacts_sync (book_client, query, &contacts, cancellable, &err)) { + if (book_client && !stop && + e_book_client_get_contacts_sync ( + book_client, query, &contacts, cancellable, &err)) { if (contacts != NULL) { if (!found_any) { - g_hash_table_insert (contact_cache, g_strdup (lowercase_addr), book_client); + g_hash_table_insert ( + contact_cache, + g_strdup (lowercase_addr), + book_client); } found_any = TRUE; @@ -565,7 +572,9 @@ search_address_in_addressbooks (const gchar *address, if (err && !stop) { gchar *source_uid = g_strdup (uid); - g_hash_table_insert (emu_broken_books_hash, source_uid, source_uid); + g_hash_table_insert ( + emu_broken_books_hash, + source_uid, source_uid); g_warning ( "%s: Can't get contacts from '%s': %s", diff --git a/libemail-engine/mail-config.c b/libemail-engine/mail-config.c index 51d34a0714..09f0332567 100644 --- a/libemail-engine/mail-config.c +++ b/libemail-engine/mail-config.c @@ -261,20 +261,25 @@ mail_config_init (EMailSession *session) g_signal_connect ( mail_settings, "changed::address-compress", - G_CALLBACK (settings_bool_value_changed), &config->address_compress); - config->address_compress = g_settings_get_boolean (mail_settings, "address-compress"); + G_CALLBACK (settings_bool_value_changed), + &config->address_compress); + config->address_compress = g_settings_get_boolean ( + mail_settings, "address-compress"); g_signal_connect ( mail_settings, "changed::address-count", - G_CALLBACK (settings_int_value_changed), &config->address_count); - config->address_count = g_settings_get_int (mail_settings, "address-count"); + G_CALLBACK (settings_int_value_changed), + &config->address_count); + config->address_count = g_settings_get_int ( + mail_settings, "address-count"); /* Junk Configuration */ g_signal_connect ( mail_settings, "changed::junk-check-custom-header", G_CALLBACK (settings_jh_check_changed), session); - config->jh_check = g_settings_get_boolean (mail_settings, "junk-check-custom-header"); + config->jh_check = g_settings_get_boolean ( + mail_settings, "junk-check-custom-header"); g_signal_connect ( mail_settings, "changed::junk-custom-header", @@ -283,12 +288,15 @@ mail_config_init (EMailSession *session) g_signal_connect ( mail_settings, "changed::junk-lookup-addressbook", G_CALLBACK (settings_bool_value_changed), &config->book_lookup); - config->book_lookup = g_settings_get_boolean (mail_settings, "junk-lookup-addressbook"); + config->book_lookup = g_settings_get_boolean ( + mail_settings, "junk-lookup-addressbook"); g_signal_connect ( mail_settings, "changed::junk-lookup-addressbook-local-only", - G_CALLBACK (settings_bool_value_changed), &config->book_lookup_local_only); - config->book_lookup_local_only = g_settings_get_boolean (mail_settings, "junk-lookup-addressbook-local-only"); + G_CALLBACK (settings_bool_value_changed), + &config->book_lookup_local_only); + config->book_lookup_local_only = g_settings_get_boolean ( + mail_settings, "junk-lookup-addressbook-local-only"); settings_jh_check_changed (mail_settings, NULL, session); } diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c index 954c14d379..5c459ef8ab 100644 --- a/libemail-engine/mail-folder-cache.c +++ b/libemail-engine/mail-folder-cache.c @@ -370,7 +370,8 @@ update_1folder (MailFolderCache *cache, if (folder_is_drafts || folder_is_outbox) { guint32 junked = 0; - if ((deleted = camel_folder_get_deleted_message_count (folder)) > 0) + deleted = camel_folder_get_deleted_message_count (folder); + if (deleted > 0) unread -= deleted; junked = camel_folder_summary_get_junk_count (folder->summary); @@ -660,8 +661,6 @@ rename_folders (MailFolderCache *cache, up = g_malloc0 (sizeof (*up)); - d(printf("oldbase '%s' newbase '%s' new '%s'\n", oldbase, newbase, fi->full_name)); - /* Form what was the old name, and try and look it up */ old = g_strdup_printf("%s%s", oldbase, fi->full_name + strlen(newbase)); mfi = g_hash_table_lookup (si->folders, old); @@ -967,7 +966,13 @@ store_has_folder_hierarchy (CamelStore *store) provider = camel_service_get_provider (CAMEL_SERVICE (store)); g_return_val_if_fail (provider != NULL, FALSE); - return (provider->flags & (CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_EXTERNAL)) != 0; + if (provider->flags & CAMEL_PROVIDER_IS_STORAGE) + return TRUE; + + if (provider->flags & CAMEL_PROVIDER_IS_EXTERNAL) + return TRUE; + + return FALSE; } static void diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c index 514105d9c2..d62b5c6521 100644 --- a/libemail-engine/mail-ops.c +++ b/libemail-engine/mail-ops.c @@ -58,12 +58,14 @@ struct _filter_mail_msg { MailMsg base; EMailSession *session; - CamelFolder *source_folder; /* where they come from */ - GPtrArray *source_uids; /* uids to copy, or NULL == copy all */ - CamelUIDCache *cache; /* UID cache if we are to cache the uids, NULL otherwise */ + CamelFolder *source_folder; /* where they come from */ + GPtrArray *source_uids; /* uids to copy, or NULL == copy all */ + CamelUIDCache *cache; /* UID cache if we are to cache + * the uids, NULL otherwise */ CamelFilterDriver *driver; - gint delete; /* delete messages after filtering them? */ - CamelFolder *destination; /* default destination for any messages, NULL for none */ + gint delete; /* delete messages after filtering? */ + CamelFolder *destination; /* default destination for any + * messages, NULL for none */ }; /* since fetching also filters, we subclass the data here */ @@ -73,7 +75,7 @@ struct _fetch_mail_msg { CamelStore *store; GCancellable *cancellable; /* we have our own cancellation * struct, the other should be empty */ - gint keep; /* keep on server? */ + gint keep; /* keep on server? */ void (*done)(gpointer data); gpointer data; @@ -190,8 +192,10 @@ mail_filter_folder (EMailSession *session, if (!notify) { /* FIXME: have a #define NOTIFY_FILTER_NAME macro? */ - /* the filter name has to stay in sync with mail-session::get_filter_driver */ - camel_filter_driver_remove_rule_by_name (m->driver, "new-mail-notification"); + /* the filter name has to stay in sync + * with mail-session::get_filter_driver */ + camel_filter_driver_remove_rule_by_name ( + m->driver, "new-mail-notification"); } mail_msg_unordered_push (m); @@ -678,13 +682,16 @@ mail_send_message (struct _send_queue_msg *m, } if (local_error != NULL) { - if (g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + if (g_error_matches ( + local_error, G_IO_ERROR, + G_IO_ERROR_CANCELLED)) goto exit; if (err->len) g_string_append(err, "\n\n"); g_string_append_printf ( - err, _("Failed to append to local 'Sent' folder: %s"), + err, _("Failed to append to " + "local 'Sent' folder: %s"), local_error->message); } } @@ -695,7 +702,9 @@ mail_send_message (struct _send_queue_msg *m, e_mail_session_handle_draft_headers_sync ( m->session, message, cancellable, &local_error); if (local_error != NULL) { - g_warning ("%s: Failed to handle draft headers: %s", G_STRFUNC, local_error->message); + g_warning ( + "%s: Failed to handle draft headers: %s", + G_STRFUNC, local_error->message); g_clear_error (&local_error); } @@ -705,7 +714,9 @@ mail_send_message (struct _send_queue_msg *m, e_mail_session_handle_source_headers_sync ( m->session, message, cancellable, &local_error); if (local_error != NULL) { - g_warning ("%s: Failed to handle source headers: %s", G_STRFUNC, local_error->message); + g_warning ( + "%s: Failed to handle source headers: %s", + G_STRFUNC, local_error->message); g_clear_error (&local_error); } } @@ -866,7 +877,9 @@ send_queue_exec (struct _send_queue_msg *m, if (j > 0) report_status ( m, CAMEL_FILTER_STATUS_END, 100, - /* Translators: The string is distinguished by total count of messages to be send. Failed messages is always more than zero. */ + /* Translators: The string is distinguished by total + * count of messages to be sent. Failed messages is + * always more than zero. */ ngettext ("Failed to send a message", "Failed to send %d of %d messages", send_uids->len), @@ -1436,7 +1449,8 @@ expunge_pop3_stores (CamelFolder *expunging, } if (any_found) - success = camel_folder_synchronize_sync (folder, TRUE, cancellable, error); + success = camel_folder_synchronize_sync ( + folder, TRUE, cancellable, error); g_object_unref (folder); |