diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-10 11:40:00 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-11 04:54:43 +0800 |
commit | 2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch) | |
tree | c34f0cbb7c500ff70f10fce846631b0a948b341c /mail | |
parent | 583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff) | |
download | gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.bz2 gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.lz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.xz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-http-request.c | 18 | ||||
-rw-r--r-- | mail/e-mail-account-store.c | 2 | ||||
-rw-r--r-- | mail/e-mail-browser.c | 2 | ||||
-rw-r--r-- | mail/e-mail-notebook-view.c | 2 | ||||
-rw-r--r-- | mail/e-mail-paned-view.c | 2 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 17 | ||||
-rw-r--r-- | mail/e-mail-tag-editor.c | 4 | ||||
-rw-r--r-- | mail/e-mail-view.c | 4 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 6 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 25 | ||||
-rw-r--r-- | mail/em-utils.c | 6 | ||||
-rw-r--r-- | mail/importers/mail-importer.c | 2 | ||||
-rw-r--r-- | mail/mail-send-recv.c | 3 |
13 files changed, 52 insertions, 41 deletions
diff --git a/mail/e-http-request.c b/mail/e-http-request.c index dd144f81a5..84b243ba7e 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -94,9 +94,10 @@ redirect_handler (SoupMessage *msg, new_uri = soup_uri_new_with_base (soup_message_get_uri (msg), new_loc); if (!new_uri) { - soup_message_set_status_full (msg, - SOUP_STATUS_MALFORMED, - "Invalid Redirect URL"); + soup_message_set_status_full ( + msg, + SOUP_STATUS_MALFORMED, + "Invalid Redirect URL"); return; } @@ -109,8 +110,8 @@ redirect_handler (SoupMessage *msg, static void send_and_handle_redirection (SoupSession *session, - SoupMessage *message, - gchar **new_location) + SoupMessage *message, + gchar **new_location) { gchar *old_uri = NULL; @@ -331,17 +332,16 @@ handle_http_request (GSimpleAsyncResult *res, /* Write the response body to cache */ error = NULL; cache_stream = camel_data_cache_add (cache, "http", uri_md5, &error); - if (!cache_stream) { + if (error != NULL) { g_warning ( "Failed to create cache file for '%s': %s", - uri, error ? error->message : "Unknown error"); + uri, error->message); g_clear_error (&error); } else { - error = NULL; camel_stream_write ( cache_stream, message->response_body->data, message->response_body->length, cancellable, &error); - if (error) { + if (error != NULL) { g_warning ( "Failed to write data to cache stream: %s", error->message); diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c index 9c777b5c6b..acbce1f20c 100644 --- a/mail/e-mail-account-store.c +++ b/mail/e-mail-account-store.c @@ -1095,7 +1095,7 @@ e_mail_account_store_set_express_mode (EMailAccountStore *store, { g_return_if_fail (E_IS_MAIL_ACCOUNT_STORE (store)); - if ((store->priv->express_mode ? 1 : 0) == (express_mode ? 1 : 0)) + if (store->priv->express_mode == express_mode) return; store->priv->express_mode = express_mode; diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 6b1eb6cd11..d0aa556cd1 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -977,7 +977,7 @@ e_mail_browser_set_show_deleted (EMailBrowser *browser, { g_return_if_fail (E_IS_MAIL_BROWSER (browser)); - if ((browser->priv->show_deleted ? 1 : 0) == (show_deleted ? 1 : 0)) + if (browser->priv->show_deleted == show_deleted) return; browser->priv->show_deleted = show_deleted; diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index f5d30d588f..4ca294fddc 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -904,7 +904,7 @@ emnv_show_prevtab (EMailNotebookView *view, priv->current_view)->parent_folder_view); pos = gtk_notebook_get_current_page (priv->book); - if (pos > 0 ) + if (pos > 0) gtk_notebook_set_current_page (priv->book, pos - 1); } diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 8ba322539e..08bedb717b 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -1098,5 +1098,5 @@ void e_mail_paned_view_set_enable_show_folder (EMailPanedView *view, gboolean set) { - view->priv->enable_show_folder = set ? 1 : 0; + view->priv->enable_show_folder = set; } diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index b08a4fcea5..ff3cf2d0fb 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -1716,24 +1716,29 @@ mail_source_retrieved (GObject *object, { CamelMimeMessage *message; EMailDisplay *display; - GError *error; + GError *error = NULL; struct _source_retrieval_closure *data; data = user_data; display = e_mail_reader_get_mail_display (data->browser); - error = NULL; message = camel_folder_get_message_finish ( CAMEL_FOLDER (object), result, &error); - if (error || !message) { + + /* Sanity check. */ + g_return_if_fail ( + ((message != NULL) && (error == NULL)) || + ((message == NULL) && (error != NULL))); + + if (error != NULL) { gchar *status; status = g_strdup_printf ( "%s<br>%s", _("Failed to retrieve message:"), - error ? error->message : _("Unknown error")); + error->message); e_mail_display_set_status (display, status); + g_error_free (error); g_free (status); - g_clear_error (&error); goto free_data; } @@ -4597,7 +4602,7 @@ e_mail_reader_set_group_by_threads (EMailReader *reader, priv = E_MAIL_READER_GET_PRIVATE (reader); - if ((group_by_threads ? 1 : 0) == (priv->group_by_threads ? 1 : 0)) + if (priv->group_by_threads == group_by_threads) return; priv->group_by_threads = group_by_threads; diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c index da87b18320..9039366563 100644 --- a/mail/e-mail-tag-editor.c +++ b/mail/e-mail-tag-editor.c @@ -382,7 +382,7 @@ e_mail_tag_editor_set_completed (EMailTagEditor *editor, { g_return_if_fail (E_IS_MAIL_TAG_EDITOR (editor)); - if ((completed ? 1 : 0) == (editor->priv->completed ? 1 : 0)) + if (editor->priv->completed == completed) return; editor->priv->completed = completed; @@ -428,7 +428,7 @@ e_mail_tag_editor_set_use_24_hour_format (EMailTagEditor *editor, { g_return_if_fail (E_IS_MAIL_TAG_EDITOR (editor)); - if ((use_24_hour_format ? 1 : 0) == (editor->priv->use_24_hour_format ? 1 : 0)) + if (editor->priv->use_24_hour_format == use_24_hour_format) return; editor->priv->use_24_hour_format = use_24_hour_format; diff --git a/mail/e-mail-view.c b/mail/e-mail-view.c index 1410d15f4e..35326a1677 100644 --- a/mail/e-mail-view.c +++ b/mail/e-mail-view.c @@ -204,7 +204,7 @@ static void mail_view_set_preview_visible (EMailView *view, gboolean preview_visible) { - if ((view->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (view->priv->preview_visible == preview_visible) return; view->priv->preview_visible = preview_visible; @@ -222,7 +222,7 @@ static void mail_view_set_show_deleted (EMailView *view, gboolean show_deleted) { - if ((view->priv->show_deleted ? 1 : 0) == (show_deleted ? 1 : 0)) + if (view->priv->show_deleted == show_deleted) return; view->priv->show_deleted = show_deleted; diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 19784351ef..15cbebc767 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1564,9 +1564,9 @@ emu_update_composers_security (EMsgComposer *composer, static void get_real_folder_uri_and_message_uid (CamelFolder *folder, - const gchar *uid, - gchar **folder_uri, - gchar **message_uid) + const gchar *uid, + gchar **folder_uri, + gchar **message_uid) { g_return_if_fail (folder != NULL); g_return_if_fail (uid != NULL); diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 590ec684df..8061356ba4 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -667,14 +667,15 @@ folder_tree_cell_edited_cb (EMFolderTree *folder_tree, } /* FIXME camel_store_rename_folder_sync() may block. */ - if (!camel_store_rename_folder_sync ( - store, old_full_name, new_full_name, NULL, &local_error)) { + camel_store_rename_folder_sync ( + store, old_full_name, new_full_name, NULL, &local_error); + + if (local_error != NULL) { e_alert_run_dialog_for_args ( parent, "mail:no-rename-folder", old_full_name, new_full_name, - local_error ? local_error->message : _("Unknown error"), NULL); - if (local_error) - g_clear_error (&local_error); + local_error->message, NULL); + g_error_free (local_error); goto exit; } @@ -2003,13 +2004,17 @@ ask_drop_folder (EMFolderTree *folder_tree, g_free (set_value); session = em_folder_tree_get_session (folder_tree); - if (!e_mail_folder_uri_parse (CAMEL_SESSION (session), - src_folder_uri, NULL, &src_folder_name, &error)) { - g_debug ( + + e_mail_folder_uri_parse ( + CAMEL_SESSION (session), + src_folder_uri, NULL, &src_folder_name, &error); + + if (error != NULL) { + g_warning ( "%s: Failed to convert '%s' to folder name: %s", - G_STRFUNC, src_folder_uri, error ? error->message : "Unknown error"); - g_clear_error (&error); + G_STRFUNC, src_folder_uri, error->message); g_object_unref (settings); + g_error_free (error); return FALSE; } diff --git a/mail/em-utils.c b/mail/em-utils.c index 80967f1f52..ec4401f95c 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -348,7 +348,7 @@ em_filename_make_safe (gchar *string) * achieve, and whether it does that as currently * written? */ - if (!g_unichar_isprint (c) || ( c < 0xff && strchr (unsafe_chars, c&0xff ))) { + if (!g_unichar_isprint (c) || (c < 0xff && strchr (unsafe_chars, c&0xff))) { while (ts < p) *ts++ = '_'; } @@ -1230,7 +1230,7 @@ em_utils_get_proxy (void) static gboolean is_only_text_part_in_this_level (GSList *parts, - EMailPart *text_html_part) + EMailPart *text_html_part) { const gchar *dot; gint level_len; @@ -1340,7 +1340,7 @@ em_utils_message_to_html (CamelSession *session, continue; /* prefer-plain can hide HTML parts, even when it's the only - text part in the email, thus show it (and hide again later) */ + * text part in the email, thus show it (and hide again later) */ if (part->is_hidden && !hidden_text_html_part && part->mime_type && !part->is_attachment && g_ascii_strcasecmp (part->mime_type, "text/html") == 0 && diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index 789a7d3611..be821063a6 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -316,7 +316,7 @@ import_folders_rec (struct _import_folders_data *m, camel_operation_push_message (m->cancellable, _("Scanning %s"), utf8_filename); g_free (utf8_filename); - while ( (d = g_dir_read_name (dir))) { + while ((d = g_dir_read_name (dir))) { if (d[0] == '.') continue; diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index baeea6e10b..7d4ebdaa1b 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -1017,7 +1017,8 @@ struct _refresh_folders_msg { static gchar * refresh_folders_desc (struct _refresh_folders_msg *m) { - return g_strdup_printf (_("Checking for new mail at '%s'"), + return g_strdup_printf ( + _("Checking for new mail at '%s'"), camel_service_get_display_name (CAMEL_SERVICE (m->store))); } |