From c85109fc322137596bf34cffc5445d568223c60d Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 12 Jul 2012 08:02:18 -0400 Subject: Coding style and whitespace cleanup. --- libemail-engine/e-mail-session-utils.c | 4 +-- libemail-engine/e-mail-session.c | 4 +-- libemail-engine/e-mail-utils.c | 30 ++++++++++---------- libemail-engine/mail-folder-cache.c | 29 ++++++++++---------- libemail-engine/mail-ops.c | 36 +++++++++++++----------- libemail-engine/mail-tools.c | 8 +++--- libemail-engine/mail-vfolder.c | 50 ++++++++++++++++++---------------- 7 files changed, 84 insertions(+), 77 deletions(-) (limited to 'libemail-engine') diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c index f9ddcb2564..f26981df33 100644 --- a/libemail-engine/e-mail-session-utils.c +++ b/libemail-engine/e-mail-session-utils.c @@ -668,7 +668,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, g_string_append_printf ( error_messages, _("Failed to append to %s: %s\n" - "Appending to local 'Sent' folder instead."), + "Appending to local 'Sent' folder instead."), context->sent_folder_uri, error->message); g_clear_error (&error); } @@ -702,7 +702,7 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, g_string_append_printf ( error_messages, _("Failed to append to %s: %s\n" - "Appending to local 'Sent' folder instead."), + "Appending to local 'Sent' folder instead."), description, error->message); g_clear_error (&error); diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c index a2f56814cf..79dcad2edf 100644 --- a/libemail-engine/e-mail-session.c +++ b/libemail-engine/e-mail-session.c @@ -1583,7 +1583,7 @@ mail_session_forward_to_sync (CamelSession *session, g_set_error ( error, CAMEL_ERROR, CAMEL_ERROR_GENERIC, _("No destination address provided, forwarding " - "of the message has been cancelled.")); + "of the message has been cancelled.")); return FALSE; } @@ -1596,7 +1596,7 @@ mail_session_forward_to_sync (CamelSession *session, g_set_error ( error, CAMEL_ERROR, CAMEL_ERROR_GENERIC, _("No identity found to use, forwarding " - "of the message has been cancelled.")); + "of the message has been cancelled.")); return FALSE; } diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c index b1308cdc3b..d842b35fdb 100644 --- a/libemail-engine/e-mail-utils.c +++ b/libemail-engine/e-mail-utils.c @@ -363,7 +363,7 @@ extern gint camel_application_is_exiting; #define NOT_FOUND_BOOK (GINT_TO_POINTER (1)) /* to be able to cancel pending requests on exit; this lock - should not be held while contact_cache lock is held */ + * should not be held while contact_cache lock is held */ G_LOCK_DEFINE_STATIC (search_addressbook_cancellables); static GSList *search_addressbook_cancellables = NULL; @@ -502,13 +502,10 @@ search_address_in_addressbooks (ESourceRegistry *registry, display_name = e_source_get_display_name (source); /* failed to load this book last time, skip it now */ - if (g_hash_table_lookup (emu_broken_books_hash, uid) != NULL) { - d(printf ("%s: skipping broken book '%s'\n", - G_STRFUNC, display_name)); + if (g_hash_table_lookup (emu_broken_books_hash, uid) != NULL) continue; - } - d(printf(" checking '%s'\n", e_source_get_uri(source))); + d (printf (" checking '%s'\n", e_source_get_uri (source))); book_client = g_hash_table_lookup (emu_books_hash, uid); if (!book_client) { @@ -759,7 +756,8 @@ em_utils_contact_photo (ESourceRegistry *registry, part = camel_mime_part_new (); if (photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { - camel_mime_part_set_content (part, + camel_mime_part_set_content ( + part, (const gchar *) photo->data.inlined.data, photo->data.inlined.length, "image/jpeg"); } else { @@ -896,7 +894,7 @@ free_mail_cache_thread (gpointer user_data) */ void emu_free_mail_cache (GDestroyNotify done_cb, - gpointer user_data) + gpointer user_data) { struct FreeMailCacheData *fmc; GThread *thread; @@ -916,7 +914,7 @@ emu_free_mail_cache (GDestroyNotify done_cb, static ESource * guess_mail_account_from_folder (ESourceRegistry *registry, CamelFolder *folder, - const gchar *message_uid) + const gchar *message_uid) { ESource *source; CamelStore *store; @@ -983,7 +981,7 @@ ESource * em_utils_guess_mail_account (ESourceRegistry *registry, CamelMimeMessage *message, CamelFolder *folder, - const gchar *message_uid) + const gchar *message_uid) { ESource *source = NULL; const gchar *newsgroups; @@ -1015,7 +1013,7 @@ ESource * em_utils_guess_mail_identity (ESourceRegistry *registry, CamelMimeMessage *message, CamelFolder *folder, - const gchar *message_uid) + const gchar *message_uid) { ESource *source; ESourceExtension *extension; @@ -1106,7 +1104,7 @@ ESource * em_utils_guess_mail_account_with_recipients (ESourceRegistry *registry, CamelMimeMessage *message, CamelFolder *folder, - const gchar *message_uid) + const gchar *message_uid) { ESource *source = NULL; GHashTable *recipients; @@ -1153,7 +1151,8 @@ em_utils_guess_mail_account_with_recipients (ESourceRegistry *registry, * in the list of To: or Cc: recipients. */ if (folder != NULL) - source = guess_mail_account_from_folder (registry, folder, message_uid); + source = guess_mail_account_from_folder ( + registry, folder, message_uid); if (source == NULL) goto second_preference; @@ -1189,7 +1188,8 @@ second_preference: goto exit; /* Last Preference: Defer to em_utils_guess_mail_account(). */ - source = em_utils_guess_mail_account (registry, message, folder, message_uid); + source = em_utils_guess_mail_account ( + registry, message, folder, message_uid); exit: g_hash_table_destroy (recipients); @@ -1201,7 +1201,7 @@ ESource * em_utils_guess_mail_identity_with_recipients (ESourceRegistry *registry, CamelMimeMessage *message, CamelFolder *folder, - const gchar *message_uid) + const gchar *message_uid) { ESource *source; ESourceExtension *extension; diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c index 71dd237799..d11db54e16 100644 --- a/libemail-engine/mail-folder-cache.c +++ b/libemail-engine/mail-folder-cache.c @@ -258,8 +258,9 @@ flush_updates_idle_cb (MailFolderCache *cache) } /* update unread counts */ - g_signal_emit (cache, signals[FOLDER_UNREAD_UPDATED], 0, - up->store, up->full_name, up->unread); + g_signal_emit ( + cache, signals[FOLDER_UNREAD_UPDATED], 0, + up->store, up->full_name, up->unread); /* indicate that the folder has changed (new mail received, etc) */ if (up->store != NULL && up->full_name != NULL) { @@ -370,7 +371,7 @@ update_1folder (MailFolderCache *cache, folder_is_drafts || folder_is_outbox; if (special_case) { - d(printf(" total count\n")); + d (printf (" total count\n")); unread = camel_folder_get_message_count (folder); if (folder_is_drafts || folder_is_outbox) { guint32 junked = 0; @@ -384,7 +385,7 @@ update_1folder (MailFolderCache *cache, unread -= junked; } } else { - d(printf(" unread count\n")); + d (printf (" unread count\n")); if (info) unread = info->unread; else @@ -392,7 +393,7 @@ update_1folder (MailFolderCache *cache, } } - d(printf("folder updated: unread %d: '%s'\n", unread, mfi->full_name)); + d (printf ("folder updated: unread %d: '%s'\n", unread, mfi->full_name)); if (unread == -1) return; @@ -514,7 +515,7 @@ unset_folder_info (MailFolderCache *cache, { struct _folder_update *up; - d(printf("unset folderinfo '%s'\n", mfi->uri)); + d (printf ("unset folderinfo '%s'\n", mfi->uri)); if (mfi->folder) { CamelFolder *folder = mfi->folder; @@ -667,7 +668,7 @@ rename_folders (MailFolderCache *cache, up = g_malloc0 (sizeof (*up)); /* Form what was the old name, and try and look it up */ - old = g_strdup_printf("%s%s", oldbase, fi->full_name + strlen(newbase)); + old = g_strdup_printf ("%s%s", oldbase, fi->full_name + strlen (newbase)); mfi = g_hash_table_lookup (si->folders, old); if (mfi) { up->oldfull = mfi->full_name; @@ -714,13 +715,13 @@ rename_folders (MailFolderCache *cache, e_filename_make_safe (olduri); newuri = e_mail_folder_uri_build (si->store, fi->full_name); e_filename_make_safe (newuri); - oldfile = g_strdup_printf("%s/custom_view-%s.xml", config_dir, olduri); - newfile = g_strdup_printf("%s/custom_view-%s.xml", config_dir, newuri); + oldfile = g_strdup_printf ("%s/custom_view-%s.xml", config_dir, olduri); + newfile = g_strdup_printf ("%s/custom_view-%s.xml", config_dir, newuri); g_rename (oldfile, newfile); g_free (oldfile); g_free (newfile); - oldfile = g_strdup_printf("%s/current_view-%s.xml", config_dir, olduri); - newfile = g_strdup_printf("%s/current_view-%s.xml", config_dir, newuri); + oldfile = g_strdup_printf ("%s/current_view-%s.xml", config_dir, olduri); + newfile = g_strdup_printf ("%s/current_view-%s.xml", config_dir, newuri); g_rename (oldfile, newfile); g_free (oldfile); g_free (newfile); @@ -1457,8 +1458,8 @@ mail_folder_cache_init (MailFolderCache *cache) g_static_rec_mutex_init (&cache->priv->stores_mutex); g_queue_init (&cache->priv->updates); - cache->priv->count_sent = getenv("EVOLUTION_COUNT_SENT") != NULL; - cache->priv->count_trash = getenv("EVOLUTION_COUNT_TRASH") != NULL; + cache->priv->count_sent = getenv ("EVOLUTION_COUNT_SENT") != NULL; + cache->priv->count_trash = getenv ("EVOLUTION_COUNT_TRASH") != NULL; buf = getenv ("EVOLUTION_PING_TIMEOUT"); timeout = buf ? strtoul (buf, NULL, 10) : 600; @@ -1620,7 +1621,7 @@ mail_folder_cache_note_folder (MailFolderCache *cache, if (cache->priv->stores == NULL || (si = g_hash_table_lookup (cache->priv->stores, parent_store)) == NULL || (mfi = g_hash_table_lookup (si->folders, full_name)) == NULL) { - w(g_warning("Noting folder before store initialised")); + w (g_warning ("Noting folder before store initialised")); g_static_rec_mutex_unlock (&cache->priv->stores_mutex); return; } diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c index ed3f44264d..f0632a4776 100644 --- a/libemail-engine/mail-ops.c +++ b/libemail-engine/mail-ops.c @@ -306,8 +306,9 @@ fetch_mail_exec (struct _fetch_mail_msg *m, if (m->fetch_count > 0) { /* We probably should fetch some old messages first. */ - m->still_more = camel_folder_fetch_messages_sync (folder, m->fetch_type, - m->fetch_count, cancellable, error) ? 1 : 0; + m->still_more = camel_folder_fetch_messages_sync ( + folder, m->fetch_type, + m->fetch_count, cancellable, error) ? 1 : 0; } service = CAMEL_SERVICE (parent_store); @@ -661,7 +662,7 @@ mail_send_message (struct _send_queue_msg *m, for (header = xev; header; header = header->next) { gchar *uri; - if (strcmp(header->name, "X-Evolution-PostTo") != 0) + if (strcmp (header->name, "X-Evolution-PostTo") != 0) continue; /* TODO: don't lose errors */ @@ -745,7 +746,7 @@ mail_send_message (struct _send_queue_msg *m, description = camel_folder_get_description (folder); if (err->len) - g_string_append(err, "\n\n"); + g_string_append (err, "\n\n"); g_string_append_printf ( err, _("Failed to append to %s: %s\n" "Appending to local 'Sent' folder instead."), @@ -767,7 +768,7 @@ mail_send_message (struct _send_queue_msg *m, goto exit; if (err->len) - g_string_append(err, "\n\n"); + g_string_append (err, "\n\n"); g_string_append_printf ( err, _("Failed to append to " "local 'Sent' folder: %s"), @@ -872,7 +873,7 @@ send_queue_exec (struct _send_queue_msg *m, gint i, j; GError *local_error = NULL; - d(printf("sending queue\n")); + d (printf ("sending queue\n")); sent_folder = e_mail_session_get_local_folder ( @@ -912,7 +913,7 @@ send_queue_exec (struct _send_queue_msg *m, report_status ( m, CAMEL_FILTER_STATUS_START, pc, - _("Sending message %d of %d"), i+1, + _("Sending message %d of %d"), i + 1, send_uids->len); camel_operation_progress ( @@ -963,9 +964,10 @@ send_queue_exec (struct _send_queue_msg *m, /* 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), + ngettext ( + "Failed to send a message", + "Failed to send %d of %d messages", + send_uids->len), j, send_uids->len); else if (g_error_matches ( m->base.error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) @@ -1201,8 +1203,9 @@ struct _sync_folder_msg { static gchar * sync_folder_desc (struct _sync_folder_msg *m) { - return g_strdup_printf (_("Storing folder '%s'"), - camel_folder_get_full_name (m->folder)); + return g_strdup_printf ( + _("Storing folder '%s'"), + camel_folder_get_full_name (m->folder)); } static void @@ -1273,10 +1276,11 @@ sync_store_desc (struct _sync_store_msg *m) uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); camel_url_free (url); - res = g_strdup_printf (m->expunge - ?_("Expunging and storing account '%s'") - :_("Storing account '%s'"), - uri); + res = g_strdup_printf ( + m->expunge ? + _("Expunging and storing account '%s'") : + _("Storing account '%s'"), + uri); g_free (uri); return res; diff --git a/libemail-engine/mail-tools.c b/libemail-engine/mail-tools.c index 29955c73d4..00cd653509 100644 --- a/libemail-engine/mail-tools.c +++ b/libemail-engine/mail-tools.c @@ -58,7 +58,7 @@ mail_tool_get_local_movemail_path (CamelStore *store, uid = camel_service_get_uid (CAMEL_SERVICE (store)); safe_uid = (guchar *) g_strdup ((const gchar *) uid); for (c = safe_uid; *c; c++) - if (strchr("/:;=|%&#!*^()\\, ", *c) || !isprint((gint) *c)) + if (strchr ("/:;=|%&#!*^()\\, ", *c) || !isprint ((gint) *c)) *c = '_'; data_dir = mail_session_get_data_dir (); @@ -74,7 +74,7 @@ mail_tool_get_local_movemail_path (CamelStore *store, return NULL; } - full = g_strdup_printf("%s/movemail.%s", path, safe_uid); + full = g_strdup_printf ("%s/movemail.%s", path, safe_uid); g_free (path); g_free (safe_uid); @@ -146,7 +146,7 @@ mail_tool_do_movemail (CamelStore *store, /* Unclear yet whether camel-movemail etc makes any sense on * Win32, at least it is not ported yet. */ - g_warning("%s: Not implemented", __FUNCTION__); + g_warning ("%s: Not implemented", __FUNCTION__); return NULL; #endif } @@ -195,7 +195,7 @@ mail_tool_remove_xevolution_headers (CamelMimeMessage *message) struct _camel_header_raw *scan, *list = NULL; for (scan = ((CamelMimePart *) message)->headers; scan; scan = scan->next) - if (!strncmp(scan->name, "X-Evolution", 11)) + if (!strncmp (scan->name, "X-Evolution", 11)) camel_header_raw_append (&list, scan->name, scan->value, scan->offset); for (scan = list; scan; scan = scan->next) diff --git a/libemail-engine/mail-vfolder.c b/libemail-engine/mail-vfolder.c index 3d695d625f..eef4d3899b 100644 --- a/libemail-engine/mail-vfolder.c +++ b/libemail-engine/mail-vfolder.c @@ -62,8 +62,8 @@ static void rule_changed (EFilterRule *rule, CamelFolder *folder); static GList * vfolder_get_include_subfolders_uris (EMailSession *session, - const gchar *base_uri, - GCancellable *cancellable) + const gchar *base_uri, + GCancellable *cancellable) { GList *uris = NULL; CamelStore *store = NULL; @@ -78,7 +78,8 @@ vfolder_get_include_subfolders_uris (EMailSession *session, if (!e_mail_folder_uri_parse (CAMEL_SESSION (session), base_uri + 1, &store, &folder_name, NULL)) return NULL; - fi = camel_store_get_folder_info_sync (store, folder_name, + fi = camel_store_get_folder_info_sync ( + store, folder_name, CAMEL_STORE_FOLDER_INFO_RECURSIVE, cancellable, NULL); cur = fi; while (cur) { @@ -145,7 +146,7 @@ vfolder_setup_exec (struct _setup_msg *m, l = l->next) { const gchar *uri = l->data; - d(printf(" Adding uri: %s\n", uri)); + d (printf (" Adding uri: %s\n", uri)); if (!uri || !*uri || !uri[1]) continue; @@ -230,9 +231,9 @@ vfolder_setup (EMailSession *session, static void vfolder_add_remove_one (GList *vfolders, - gboolean remove, - CamelFolder *folder, - GCancellable *cancellable) + gboolean remove, + CamelFolder *folder, + GCancellable *cancellable) { GList *iter; @@ -466,7 +467,7 @@ mail_vfolder_add_folder (CamelStore *store, gint found = FALSE; if (!rule->name) { - d(printf("invalid rule (%p): rule->name is set to NULL\n", rule)); + d (printf ("invalid rule (%p): rule->name is set to NULL\n", rule)); continue; } @@ -559,7 +560,7 @@ mail_vfolder_delete_folder (CamelStore *store, if (folder_is_spethal (store, folder_name)) return; - d(printf ("Deleting uri to check: %s\n", uri)); + d (printf ("Deleting uri to check: %s\n", uri)); g_return_if_fail (mail_in_main_thread ()); @@ -680,7 +681,7 @@ mail_vfolder_rename_folder (CamelStore *store, gchar *old_uri; gchar *new_uri; - d(printf("vfolder rename uri: %s to %s\n", cfrom, cto)); + d (printf ("vfolder rename uri: %s to %s\n", cfrom, cto)); if (context == NULL) return; @@ -743,7 +744,7 @@ mail_vfolder_rename_folder (CamelStore *store, const gchar *config_dir; gchar *user; - d(printf("Vfolders updated from renamed folder\n")); + d (printf ("Vfolders updated from renamed folder\n")); config_dir = mail_session_get_config_dir (); user = g_build_filename (config_dir, "vfolders.xml", NULL); e_rule_context_save ((ERuleContext *) context, user); @@ -762,7 +763,7 @@ static void rule_add_sources (EMailSession *session, GQueue *queue, GList **sources_urip, - EMVFolderRule *rule) + EMVFolderRule *rule) { GList *sources_uri = *sources_urip; MailFolderCache *folder_cache; @@ -849,9 +850,10 @@ rule_changed (EFilterRule *rule, g_object_unref (service); service = NULL; - d(printf("Filter rule changed? for folder '%s'!!\n", folder->name)); + d (printf ("Filter rule changed? for folder '%s'!!\n", folder->name)); - camel_vee_folder_set_auto_update (CAMEL_VEE_FOLDER (folder), + camel_vee_folder_set_auto_update ( + CAMEL_VEE_FOLDER (folder), em_vfolder_rule_get_autoupdate ((EMVFolderRule *) rule)); if (em_vfolder_rule_get_with ((EMVFolderRule *) rule) == EM_VFOLDER_RULE_WITH_SPECIFIC) { @@ -895,7 +897,7 @@ rule_changed (EFilterRule *rule, G_UNLOCK (vfolder); - query = g_string_new(""); + query = g_string_new (""); e_filter_rule_build_code (rule, query); vfolder_setup (session, folder, query->str, sources_uri); @@ -911,7 +913,7 @@ context_rule_added (ERuleContext *ctx, CamelFolder *folder; CamelService *service; - d(printf("rule added: %s\n", rule->name)); + d (printf ("rule added: %s\n", rule->name)); service = camel_session_ref_service ( CAMEL_SESSION (session), E_MAIL_SESSION_VFOLDER_UID); @@ -944,7 +946,7 @@ context_rule_removed (ERuleContext *ctx, CamelService *service; gpointer key, folder = NULL; - d(printf("rule removed; %s\n", rule->name)); + d (printf ("rule removed; %s\n", rule->name)); service = camel_session_ref_service ( CAMEL_SESSION (session), E_MAIL_SESSION_VFOLDER_UID); @@ -976,7 +978,7 @@ store_folder_deleted_cb (CamelStore *store, EFilterRule *rule; gchar *user; - d(printf("Folder deleted: %s\n", info->name)); + d (printf ("Folder deleted: %s\n", info->name)); /* Unmatched folder doesn't have any rule */ if (g_strcmp0 (CAMEL_UNMATCHED_NAME, info->full_name) == 0) @@ -1027,11 +1029,11 @@ store_folder_renamed_cb (CamelStore *store, /* This should be more-or-less thread-safe */ - d(printf("Folder renamed to '%s' from '%s'\n", info->full_name, old_name)); + d (printf ("Folder renamed to '%s' from '%s'\n", info->full_name, old_name)); /* Folder is already renamed? */ G_LOCK (vfolder); - d(printf("Changing folder name in hash table to '%s'\n", info->full_name)); + d (printf ("Changing folder name in hash table to '%s'\n", info->full_name)); if (g_hash_table_lookup_extended (vfolder_hash, old_name, &key, &folder)) { const gchar *config_dir; @@ -1062,7 +1064,7 @@ store_folder_renamed_cb (CamelStore *store, G_UNLOCK (vfolder); } else { G_UNLOCK (vfolder); - g_warning("couldn't find a vfolder rule in our table? %s", info->full_name); + g_warning ("couldn't find a vfolder rule in our table? %s", info->full_name); } } @@ -1146,7 +1148,7 @@ vfolder_load_storage (EMailSession *session) xmlfile = g_build_filename (EVOLUTION_PRIVDATADIR, "vfoldertypes.xml", NULL); if (e_rule_context_load ((ERuleContext *) context, xmlfile, user) != 0) { - g_warning("cannot load vfolders: %s\n", ((ERuleContext *)context)->error); + g_warning ("cannot load vfolders: %s\n", ((ERuleContext *) context)->error); } g_free (xmlfile); g_free (user); @@ -1162,10 +1164,10 @@ vfolder_load_storage (EMailSession *session) rule = NULL; while ((rule = e_rule_context_next_rule ((ERuleContext *) context, rule, NULL))) { if (rule->name) { - d(printf("rule added: %s\n", rule->name)); + d (printf ("rule added: %s\n", rule->name)); context_rule_added ((ERuleContext *) context, rule, session); } else { - d(printf("invalid rule (%p) encountered: rule->name is NULL\n", rule)); + d (printf ("invalid rule (%p) encountered: rule->name is NULL\n", rule)); } } -- cgit v1.2.3