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 /modules | |
parent | 583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff) | |
download | gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'modules')
20 files changed, 74 insertions, 60 deletions
diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index d2ce13f099..84c8b31699 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -703,7 +703,7 @@ e_book_shell_content_set_preview_visible (EBookShellContent *book_shell_content, { g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content)); - if ((book_shell_content->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (book_shell_content->priv->preview_visible == preview_visible) return; book_shell_content->priv->preview_visible = preview_visible; @@ -726,7 +726,7 @@ e_book_shell_content_set_preview_show_maps (EBookShellContent *book_shell_conten { g_return_if_fail (E_IS_BOOK_SHELL_CONTENT (book_shell_content)); - if ((book_shell_content->priv->preview_show_maps ? 1 : 0) == (show_maps ? 1 : 0)) + if (book_shell_content->priv->preview_show_maps == show_maps) return; book_shell_content->priv->preview_show_maps = show_maps; diff --git a/modules/bogofilter/evolution-bogofilter.c b/modules/bogofilter/evolution-bogofilter.c index 00bb763151..01374eaa0d 100644 --- a/modules/bogofilter/evolution-bogofilter.c +++ b/modules/bogofilter/evolution-bogofilter.c @@ -253,7 +253,7 @@ static void bogofilter_set_convert_to_unicode (EBogofilter *extension, gboolean convert_to_unicode) { - if ((extension->convert_to_unicode ? 1 : 0) == (convert_to_unicode ? 1 : 0)) + if (extension->convert_to_unicode == convert_to_unicode) return; extension->convert_to_unicode = convert_to_unicode; diff --git a/modules/book-config-ldap/e-source-ldap.c b/modules/book-config-ldap/e-source-ldap.c index 42d8a08eab..854552f2f5 100644 --- a/modules/book-config-ldap/e-source-ldap.c +++ b/modules/book-config-ldap/e-source-ldap.c @@ -485,7 +485,7 @@ e_source_ldap_set_can_browse (ESourceLDAP *extension, { g_return_if_fail (E_IS_SOURCE_LDAP (extension)); - if ((extension->priv->can_browse ? 1 : 0) == (can_browse ? 1 : 0)) + if (extension->priv->can_browse == can_browse) return; extension->priv->can_browse = can_browse; diff --git a/modules/book-config-ldap/evolution-book-config-ldap.c b/modules/book-config-ldap/evolution-book-config-ldap.c index 3aa83de243..42cea3b5d5 100644 --- a/modules/book-config-ldap/evolution-book-config-ldap.c +++ b/modules/book-config-ldap/evolution-book-config-ldap.c @@ -871,9 +871,10 @@ book_config_ldap_insert_widgets (ESourceConfigBackend *backend, book_config_ldap_active_to_port, NULL, (GDestroyNotify) NULL); - /* "active" doesn't change when setting custom port in entry, - thus check also on the "changed" signal */ - g_signal_connect (context->port_combo, "changed", + /* "active" doesn't change when setting custom port + * in entry, so check also on the "changed" signal. */ + g_signal_connect ( + context->port_combo, "changed", G_CALLBACK (book_config_ldap_port_combo_changed), NULL); g_object_bind_property ( @@ -929,10 +930,9 @@ book_config_ldap_insert_widgets (ESourceConfigBackend *backend, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); - /* initialize values from UI into extension, if the source - is a fresh new source; bindings will take care of proper - values setting into extension properties - */ + /* Initialize values from UI into extension, if the source + * is a fresh new source; bindings will take care of proper + * values setting into extension properties. */ if (is_new_source) { g_object_notify (G_OBJECT (context->host_entry), "text"); g_object_notify (G_OBJECT (context->port_combo), "active"); diff --git a/modules/cal-config-contacts/e-source-contacts.c b/modules/cal-config-contacts/e-source-contacts.c index c19cc6694b..8d9364d87b 100644 --- a/modules/cal-config-contacts/e-source-contacts.c +++ b/modules/cal-config-contacts/e-source-contacts.c @@ -163,7 +163,7 @@ e_source_contacts_set_include_me (ESourceContacts *extension, { g_return_if_fail (E_IS_SOURCE_CONTACTS (extension)); - if ((extension->priv->include_me ? 1 : 0) == (include_me ? 1 : 0)) + if (extension->priv->include_me == include_me) return; extension->priv->include_me = include_me; diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index cb5fb243e9..84193d9623 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -577,17 +577,22 @@ ensure_alarm_notify_is_running (void) filename = g_build_filename (base_dir, "evolution-alarm-notify", NULL); - if (g_file_test (filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_EXECUTABLE)) { + if (g_file_test (filename, G_FILE_TEST_IS_EXECUTABLE)) { gchar *argv[2]; GError *error = NULL; argv[0] = filename; argv[1] = NULL; - if (!g_spawn_async (base_dir, argv, NULL, 0, NULL, NULL, NULL, &error)) - g_message ("Failed to start '%s': %s", filename, error ? error->message : "Unknown error"); + g_spawn_async ( + base_dir, argv, NULL, 0, NULL, NULL, NULL, &error); - g_clear_error (&error); + if (error != NULL) { + g_message ( + "Failed to start '%s': %s", + filename, error->message); + g_error_free (error); + } } g_free (filename); diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 9eb8d66dcc..8d20cd974a 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -204,7 +204,8 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie gnome_calendar_notify_dates_shown_changed (calendar); - g_signal_handlers_block_by_func (calitem, + g_signal_handlers_block_by_func ( + calitem, cal_shell_view_date_navigator_selection_changed_cb, cal_shell_view); /* make sure the selected days in the calendar matches shown days */ @@ -217,7 +218,8 @@ cal_shell_view_date_navigator_selection_changed_cb (ECalShellView *cal_shell_vie e_calendar_item_set_selection (calitem, &start_date, &end_date); - g_signal_handlers_unblock_by_func (calitem, + g_signal_handlers_unblock_by_func ( + calitem, cal_shell_view_date_navigator_selection_changed_cb, cal_shell_view); } diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index ab9f3180be..bb92852956 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -745,7 +745,7 @@ e_memo_shell_content_set_preview_visible (EMemoShellContent *memo_shell_content, { g_return_if_fail (E_IS_MEMO_SHELL_CONTENT (memo_shell_content)); - if ((memo_shell_content->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (memo_shell_content->priv->preview_visible == preview_visible) return; memo_shell_content->priv->preview_visible = preview_visible; diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 1550afeae8..f1ae7ffefb 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -959,7 +959,7 @@ e_memo_shell_view_actions_init (EMemoShellView *memo_shell_view) ACTION (MEMO_VIEW_VERTICAL), "current-value", G_SETTINGS_BIND_DEFAULT); - g_object_unref (G_OBJECT (memo_settings)); + g_object_unref (memo_settings); /* Fine tuning. */ diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 3fe5f68f51..89d4bde096 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -301,7 +301,7 @@ task_shell_content_restore_state_cb (EShellWindow *shell_window, priv->paned, "vposition", G_SETTINGS_BIND_DEFAULT); - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); } static GtkOrientation @@ -770,7 +770,7 @@ e_task_shell_content_set_preview_visible (ETaskShellContent *task_shell_content, { g_return_if_fail (E_IS_TASK_SHELL_CONTENT (task_shell_content)); - if ((task_shell_content->priv->preview_visible ? 1 : 0) == (preview_visible ? 1 : 0)) + if (task_shell_content->priv->preview_visible == preview_visible) return; task_shell_content->priv->preview_visible = preview_visible; diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index e9898fe971..21043fb998 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1158,7 +1158,7 @@ e_task_shell_view_actions_init (ETaskShellView *task_shell_view) ACTION (TASK_VIEW_VERTICAL), "current-value", G_SETTINGS_BIND_DEFAULT); - g_object_unref (G_OBJECT (settings)); + g_object_unref (settings); /* Fine tuning. */ diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c index f8e8323c3e..b7684a30d8 100644 --- a/modules/calendar/e-task-shell-view.c +++ b/modules/calendar/e-task-shell-view.c @@ -531,7 +531,7 @@ e_task_shell_view_set_confirm_purge (ETaskShellView *task_shell_view, { g_return_if_fail (E_IS_TASK_SHELL_VIEW (task_shell_view)); - if ((task_shell_view->priv->confirm_purge ? 1 : 0) == (confirm_purge ? 1 : 0)) + if (task_shell_view->priv->confirm_purge == confirm_purge) return; task_shell_view->priv->confirm_purge = confirm_purge; diff --git a/modules/itip-formatter/e-source-conflict-search.c b/modules/itip-formatter/e-source-conflict-search.c index 4319b572cc..8cf436de3a 100644 --- a/modules/itip-formatter/e-source-conflict-search.c +++ b/modules/itip-formatter/e-source-conflict-search.c @@ -144,7 +144,7 @@ e_source_conflict_search_set_include_me (ESourceConflictSearch *extension, { g_return_if_fail (E_IS_SOURCE_CONFLICT_SEARCH (extension)); - if ((extension->priv->include_me ? 1 : 0) == (include_me ? 1 : 0)) + if (extension->priv->include_me == include_me) return; extension->priv->include_me = include_me; diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c index 9bf92965d8..c40746a8dc 100644 --- a/modules/itip-formatter/itip-view.c +++ b/modules/itip-formatter/itip-view.c @@ -761,7 +761,7 @@ button_clicked_cb (WebKitDOMElement *element, response = atoi (responseStr); //d (printf ("Clicked btton %d\n", response)); - g_signal_emit (G_OBJECT (data), signals[RESPONSE], 0, response); + g_signal_emit (data, signals[RESPONSE], 0, response); } static void @@ -885,9 +885,9 @@ append_text_table_row (GString *buffer, static void append_text_table_row_nonempty (GString *buffer, - const gchar *id, - const gchar *label, - const gchar *value) + const gchar *id, + const gchar *label, + const gchar *value) { if (!value || !*value) return; @@ -4087,7 +4087,7 @@ find_cal_opened_cb (GObject *source_object, static void itip_cancellable_cancelled (GCancellable *itip_cancellable, - GCancellable *fd_cancellable) + GCancellable *fd_cancellable) { g_cancellable_cancel (fd_cancellable); } @@ -4195,7 +4195,8 @@ find_server (EMailPartItip *pitip, fd->view = view; fd->itip_cancellable = g_object_ref (pitip->cancellable); fd->cancellable = g_cancellable_new (); - fd->cancelled_id = g_cancellable_connect (fd->itip_cancellable, + fd->cancelled_id = g_cancellable_connect ( + fd->itip_cancellable, G_CALLBACK (itip_cancellable_cancelled), fd->cancellable, NULL); fd->conflicts = g_hash_table_new (g_direct_hash, g_direct_equal); fd->uid = g_strdup (uid); @@ -4563,7 +4564,9 @@ receive_objects_ready_cb (GObject *ecalclient, EMailPartItip *pitip = itip_view_get_mail_part (view); GError *error = NULL; - if (!e_cal_client_receive_objects_finish (client, result, &error)) { + e_cal_client_receive_objects_finish (client, result, &error); + + if (error != NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { update_item_progress_info (pitip, view, NULL); @@ -4571,9 +4574,10 @@ receive_objects_ready_cb (GObject *ecalclient, itip_view_add_lower_info_item_printf ( view, ITIP_VIEW_INFO_ITEM_TYPE_INFO, _("Unable to send item to calendar '%s'. %s"), - e_source_get_display_name (source), error ? error->message : _("Unknown error")); + e_source_get_display_name (source), + error->message); } - g_clear_error (&error); + g_error_free (error); return; } @@ -4910,21 +4914,22 @@ modify_object_cb (GObject *ecalclient, EMailPartItip *pitip = itip_view_get_mail_part (view); GError *error = NULL; - if (!e_cal_client_modify_object_finish (client, result, &error)) { - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || - g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { - g_clear_error (&error); - return; - } + e_cal_client_modify_object_finish (client, result, &error); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) || + g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { + g_error_free (error); + return; + } + + if (error != NULL) { update_item_progress_info (pitip, view, NULL); pitip->update_item_error_info_id = itip_view_add_lower_info_item_printf ( view, ITIP_VIEW_INFO_ITEM_TYPE_ERROR, _("Unable to update attendee. %s"), - error ? error->message : _("Unknown error")); - - g_clear_error (&error); + error->message); + g_error_free (error); } else { update_item_progress_info (pitip, view, NULL); itip_view_add_lower_info_item ( @@ -5803,7 +5808,7 @@ in_proper_folder (ESourceRegistry *registry, res = ((flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_TRASH && (flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_JUNK && /* it can be Inbox */ - ( (flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX || + ((flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_INBOX || /* or any other virtual folder */ CAMEL_IS_VEE_FOLDER (folder) || /* or anything else except of sent, outbox or drafts folder */ diff --git a/modules/mail-config/e-mail-config-sendmail-backend.c b/modules/mail-config/e-mail-config-sendmail-backend.c index 4487406811..f656caa6ee 100644 --- a/modules/mail-config/e-mail-config-sendmail-backend.c +++ b/modules/mail-config/e-mail-config-sendmail-backend.c @@ -34,7 +34,7 @@ G_DEFINE_DYNAMIC_TYPE ( static void mail_config_sendmail_backend_insert_widgets (EMailConfigServiceBackend *backend, - GtkBox *parent) + GtkBox *parent) { CamelSettings *settings; GtkLabel *label; @@ -171,7 +171,8 @@ mail_config_sendmail_backend_check_complete (EMailConfigServiceBackend *backend) settings = e_mail_config_service_backend_get_settings (backend); - g_object_get (G_OBJECT (settings), + g_object_get ( + G_OBJECT (settings), "use-custom-binary", &use_custom_binary, "custom-binary", &custom_binary, NULL); diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c index 69cbfe6d73..8bc2aad12d 100644 --- a/modules/mail/e-mail-attachment-handler.c +++ b/modules/mail/e-mail-attachment-handler.c @@ -98,7 +98,7 @@ mail_attachment_handler_forward (GtkAction *action, static void mail_attachment_handler_reply (EAttachmentHandler *handler, - EMailReplyType reply_type) + EMailReplyType reply_type) { EMailAttachmentHandlerPrivate *priv; EShellSettings *shell_settings; diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 83a4fa48fe..9376f437ae 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -258,7 +258,7 @@ mail_shell_view_folder_tree_popup_event_cb (EShellView *shell_view, static gboolean mail_shell_view_mail_display_needs_key (EMailDisplay *mail_display, - gboolean with_input) + gboolean with_input) { gboolean needs_key = FALSE; @@ -338,10 +338,10 @@ mail_shell_view_key_press_event_cb (EMailShellView *mail_shell_view, window = webkit_dom_document_get_default_view (document); /* Workaround WebKit bug for key navigation, when inner IFRAME is focused. - EMailView's inner IFRAMEs have disabled scrolling, but WebKit doesn't post - key navigation events to parent's frame, thus the view doesn't scroll. - This is a poor workaround for this issue, the main frame is focused, - which has scrolling enabled. + * EMailView's inner IFRAMEs have disabled scrolling, but WebKit doesn't post + * key navigation events to parent's frame, thus the view doesn't scroll. + * This is a poor workaround for this issue, the main frame is focused, + * which has scrolling enabled. */ webkit_dom_dom_window_focus (window); } diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index 47d571b3e6..66ff32106c 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -200,8 +200,9 @@ empe_prefer_plain_parse (EMailParserExtension *extension, if (emp_pp->mode != ONLY_PLAIN) return NULL; - /* Enforcing text/plain, but got only HTML part, thus add it as attachment, - to not show empty message preview, which is confusing */ + /* Enforcing text/plain, but got only HTML part, so add it + * as attachment, to not show empty message preview, which + * is confusing. */ return make_part_attachment ( parser, part, part_id, FALSE, cancellable); diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c index 6a8affab83..2202f71003 100644 --- a/modules/spamassassin/evolution-spamassassin.c +++ b/modules/spamassassin/evolution-spamassassin.c @@ -334,7 +334,7 @@ static void spam_assassin_set_local_only (ESpamAssassin *extension, gboolean local_only) { - if ((extension->local_only ? 1 : 0) == (local_only ? 1 : 0)) + if (extension->local_only == local_only) return; extension->local_only = local_only; @@ -1090,16 +1090,16 @@ e_spam_assassin_init (ESpamAssassin *extension) g_settings_bind ( settings, "local-only", - G_OBJECT (extension), "local-only", + extension, "local-only", G_SETTINGS_BIND_DEFAULT); g_settings_bind ( settings, "socket-path", - G_OBJECT (extension), "socket-path", + extension, "socket-path", G_SETTINGS_BIND_DEFAULT); #ifdef HAVE_SPAM_DAEMON g_settings_bind ( settings, "use-daemon", - G_OBJECT (extension), "use-daemon", + extension, "use-daemon", G_SETTINGS_BIND_DEFAULT); #endif /* HAVE_SPAM_DAEMON */ diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c index 21bf74d849..3de54e627f 100644 --- a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c +++ b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c @@ -1204,7 +1204,7 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { if ((filename = MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BOOLEAN, 0x8506))) != MAPI_UNDEFINED) { dword_ptr = (DWORD *) filename->data; - fprintf (fptr, "CLASS:" ); + fprintf (fptr, "CLASS:"); if (*dword_ptr == 1) { fprintf (fptr,"PRIVATE\n"); } else { @@ -1338,7 +1338,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { PROP_TAG (PT_BOOLEAN, 0x8506)); if (filename != MAPI_UNDEFINED) { dword_ptr = (DWORD *) filename->data; - fprintf (fptr, "CLASS:" ); + fprintf (fptr, "CLASS:"); if (*dword_ptr == 1) { fprintf (fptr,"PRIVATE\n"); } else { |