From 2c4ae5e7685c462f8d464448e4617b8dea029e72 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 9 Nov 2012 22:40:00 -0500 Subject: Coding style and whitespace cleanup. --- .../gui/contact-editor/e-contact-editor-fullname.c | 13 ++-- addressbook/gui/contact-editor/e-contact-editor.c | 29 ++++---- .../gui/contact-editor/e-contact-quick-add.c | 42 +++++++----- addressbook/gui/contact-editor/eab-editor.c | 79 +++++++++++----------- 4 files changed, 89 insertions(+), 74 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 8dc2621787..4777091128 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -253,9 +253,10 @@ e_contact_editor_fullname_new (const EContactName *name) { GtkWidget *widget = g_object_new (E_TYPE_CONTACT_EDITOR_FULLNAME, NULL); - g_object_set (widget, - "name", name, - NULL); + g_object_set ( + widget, + "name", name, + NULL); return widget; } @@ -320,9 +321,9 @@ extract_info (EContactEditorFullname *editor) editor->name = name; } - name->prefixes = extract_field (editor, "comboentry-title" ); - name->given = extract_field (editor, "entry-first" ); + name->prefixes = extract_field (editor, "comboentry-title"); + name->given = extract_field (editor, "entry-first"); name->additional = extract_field (editor, "entry-middle"); - name->family = extract_field (editor, "entry-last" ); + name->family = extract_field (editor, "entry-last"); name->suffixes = extract_field (editor, "comboentry-suffix"); } diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index d2111f0def..8e2e455dc1 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -689,7 +689,7 @@ sensitize_ok (EContactEditor *ce) GtkWidget *widget; gboolean allow_save; GtkWidget *entry_fullname = - e_builder_get_widget (ce->builder, "entry-fullname" ); + e_builder_get_widget (ce->builder, "entry-fullname"); GtkWidget *entry_file_as = gtk_bin_get_child (GTK_BIN ( e_builder_get_widget (ce->builder, "combo-file-as"))); @@ -808,7 +808,8 @@ init_email_record_location (EContactEditor *editor, for (i = 0; i < G_N_ELEMENTS (common_location); i++) { gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, _(common_location[i].pretty_name), -1); } @@ -1894,8 +1895,8 @@ extract_im (EContactEditor *editor) old_service_attr_list = e_contact_get_attributes ( editor->contact, im_service[i].field); - filled_in_slots = - MIN (remaining_slots, + filled_in_slots = MIN ( + remaining_slots, g_list_length (old_service_attr_list)); remaining_slots -= filled_in_slots; @@ -2289,9 +2290,11 @@ set_address_label (EContact *contact, g_object_unref (settings); if (format_address) { - address_label = eab_format_address (contact, - (field == E_CONTACT_ADDRESS_LABEL_WORK) ? E_CONTACT_ADDRESS_WORK : - E_CONTACT_ADDRESS_HOME); + address_label = eab_format_address ( + contact, + (field == E_CONTACT_ADDRESS_LABEL_WORK) ? + E_CONTACT_ADDRESS_WORK : + E_CONTACT_ADDRESS_HOME); } if (!format_address || !address_label) { @@ -2702,7 +2705,8 @@ extract_simple_field (EContactEditor *editor, gtk_combo_box_get_model ( GTK_COMBO_BOX (widget))); - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, + gtk_tree_model_get ( + GTK_TREE_MODEL (store), &iter, 0, &text, -1); } @@ -2776,7 +2780,7 @@ extract_simple_field (EContactEditor *editor, NULL); if (prompt_response == GTK_RESPONSE_YES) { - if ( width > height) { + if (width > height) { height = height * 96 / width; width = 96; } else { @@ -3681,7 +3685,7 @@ save_contact (EContactEditor *ce, return; } - entry_fullname = e_builder_get_widget (ce->builder, "entry-fullname" ); + entry_fullname = e_builder_get_widget (ce->builder, "entry-fullname"); entry_file_as = gtk_bin_get_child ( GTK_BIN (e_builder_get_widget (ce->builder, "combo-file-as"))); company_name = e_builder_get_widget (ce->builder, "entry-company"); @@ -3794,8 +3798,9 @@ e_contact_editor_is_valid (EABEditor *editor) /* If valid, see if the birthday is a future date */ bday = e_date_edit_get_time (E_DATE_EDIT (widget)); if (bday > now) { - g_string_append_printf (errmsg, _("'%s' cannot be a future date"), - e_contact_pretty_name (E_CONTACT_BIRTH_DATE)); + g_string_append_printf ( + errmsg, _("'%s' cannot be a future date"), + e_contact_pretty_name (E_CONTACT_BIRTH_DATE)); validation_error = TRUE; } diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index fd4c8edb82..e9076a9df8 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -492,34 +492,40 @@ build_quick_add_dialog (QuickAdd *qa) gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->name_entry); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, - 0, 1, 0, 1, - GTK_FILL, 0, xpad, ypad); - gtk_table_attach (table, qa->name_entry, - 1, 2, 0, 1, - GTK_EXPAND | GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, label, + 0, 1, 0, 1, + GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, qa->name_entry, + 1, 2, 0, 1, + GTK_EXPAND | GTK_FILL, 0, xpad, ypad); label = gtk_label_new_with_mnemonic (_("E_mail")); gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->email_entry); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, - 0, 1, 1, 2, - GTK_FILL, 0, xpad, ypad); - gtk_table_attach (table, qa->email_entry, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, label, + 0, 1, 1, 2, + GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, qa->email_entry, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, 0, xpad, ypad); label = gtk_label_new_with_mnemonic (_("_Select Address Book")); gtk_label_set_mnemonic_widget ((GtkLabel *) label, qa->combo_box); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (table, label, - 0, 1, 2, 3, - GTK_FILL, 0, xpad, ypad); - gtk_table_attach (table, qa->combo_box, - 1, 2, 2, 3, - GTK_EXPAND | GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, label, + 0, 1, 2, 3, + GTK_FILL, 0, xpad, ypad); + gtk_table_attach ( + table, qa->combo_box, + 1, 2, 2, 3, + GTK_EXPAND | GTK_FILL, 0, xpad, ypad); gtk_container_set_border_width (GTK_CONTAINER (table), 12); container = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index a7165e70d8..fcbdfb1049 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -175,44 +175,47 @@ eab_editor_class_init (EABEditorClass *class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); - signals[CONTACT_ADDED] = - g_signal_new ("contact_added", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, contact_added), - NULL, NULL, - e_marshal_NONE__POINTER_OBJECT, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_OBJECT); - - signals[CONTACT_MODIFIED] = - g_signal_new ("contact_modified", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, contact_modified), - NULL, NULL, - e_marshal_NONE__POINTER_OBJECT, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_OBJECT); - - signals[CONTACT_DELETED] = - g_signal_new ("contact_deleted", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, contact_deleted), - NULL, NULL, - e_marshal_NONE__POINTER_OBJECT, - G_TYPE_NONE, 2, - G_TYPE_POINTER, G_TYPE_OBJECT); - - signals[EDITOR_CLOSED] = - g_signal_new ("editor_closed", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (EABEditorClass, editor_closed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); + signals[CONTACT_ADDED] = g_signal_new ( + "contact_added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, contact_added), + NULL, NULL, + e_marshal_NONE__POINTER_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_OBJECT); + + signals[CONTACT_MODIFIED] = g_signal_new ( + "contact_modified", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, contact_modified), + NULL, NULL, + e_marshal_NONE__POINTER_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_OBJECT); + + signals[CONTACT_DELETED] = g_signal_new ( + "contact_deleted", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, contact_deleted), + NULL, NULL, + e_marshal_NONE__POINTER_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_POINTER, + G_TYPE_OBJECT); + + signals[EDITOR_CLOSED] = g_signal_new ( + "editor_closed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EABEditorClass, editor_closed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); } static void -- cgit v1.2.3