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. --- .../contact-list-editor/e-contact-list-editor.c | 32 +++++++++++-------- .../gui/contact-list-editor/e-contact-list-model.c | 37 ++++++++++++++-------- 2 files changed, 43 insertions(+), 26 deletions(-) (limited to 'addressbook/gui/contact-list-editor') diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index e3cb38ec96..a6205757d8 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -508,7 +508,8 @@ contact_list_editor_add_button_clicked_cb (GtkWidget *widget) editor = contact_list_editor_extract (widget); - contact_list_editor_add_email (editor, + contact_list_editor_add_email ( + editor, gtk_entry_get_text (GTK_ENTRY (WIDGET (EMAIL_ENTRY)))); gtk_entry_set_text (GTK_ENTRY (WIDGET (EMAIL_ENTRY)), ""); } @@ -1208,7 +1209,8 @@ setup_custom_widgets (EContactListEditor *editor) gtk_widget_get_name (old)); parent = gtk_widget_get_parent (old); - gtk_container_child_get (GTK_CONTAINER (parent), old, + gtk_container_child_get ( + GTK_CONTAINER (parent), old, "bottom-attach", &ba, "left-attach", &la, "right-attach", &ra, @@ -1660,12 +1662,13 @@ e_contact_list_editor_new (EShell *shell, E_TYPE_CONTACT_LIST_EDITOR, "shell", shell, NULL); - g_object_set (editor, - "client", book_client, - "contact", list_contact, - "is_new_list", is_new_list, - "editable", editable, - NULL); + g_object_set ( + editor, + "client", book_client, + "contact", list_contact, + "is_new_list", is_new_list, + "editable", editable, + NULL); return editor; } @@ -1721,9 +1724,11 @@ save_contact_list (GtkTreeModel *model, uid = g_strdup_printf ("%d", *parent_id); attr = e_vcard_attribute_new (NULL, EVC_CONTACT_LIST); - e_vcard_attribute_add_param_with_value (attr, + e_vcard_attribute_add_param_with_value ( + attr, e_vcard_attribute_param_new (EVC_CL_UID), uid); - e_vcard_attribute_add_value (attr, + e_vcard_attribute_add_value ( + attr, e_destination_get_name (dest)); g_free (uid); @@ -1738,7 +1743,8 @@ save_contact_list (GtkTreeModel *model, e_destination_export_to_vcard_attribute (dest, attr); } - e_vcard_attribute_add_param_with_value (attr, + e_vcard_attribute_add_param_with_value ( + attr, e_vcard_attribute_param_new (EVC_PARENT_CL), pid_str); *attrs = g_slist_prepend (*attrs, attr); @@ -1889,7 +1895,7 @@ e_contact_list_editor_set_is_new_list (EContactListEditor *editor, g_return_if_fail (E_IS_CONTACT_LIST_EDITOR (editor)); - if ((editor->priv->is_new_list ? 1 : 0) == (is_new_list ? 1 : 0)) + if (editor->priv->is_new_list == is_new_list) return; editor->priv->is_new_list = is_new_list; @@ -1912,7 +1918,7 @@ e_contact_list_editor_set_editable (EContactListEditor *editor, { g_return_if_fail (E_IS_CONTACT_LIST_EDITOR (editor)); - if ((editor->priv->editable ? 1 : 0) == (editable ? 1 : 0)) + if (editor->priv->editable == editable) return; editor->priv->editable = editable; diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index 55cc70bec7..337fd351e4 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -152,8 +152,9 @@ e_contact_list_model_add_destination (EContactListModel *model, if (e_destination_is_evolution_list (destination)) { const GList *dest, *dests = e_destination_list_get_root_dests (destination); /* Get number of instances of this list in the model */ - gint list_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->uids_table, - e_destination_get_contact_uid (destination))); + gint list_refs = GPOINTER_TO_INT ( + g_hash_table_lookup (model->priv->uids_table, + e_destination_get_contact_uid (destination))); gtk_tree_store_append (GTK_TREE_STORE (model), &iter, parent); gtk_tree_store_set (GTK_TREE_STORE (model), &iter, 0, destination, -1); @@ -170,7 +171,8 @@ e_contact_list_model_add_destination (EContactListModel *model, if (!gtk_tree_model_iter_has_child (GTK_TREE_MODEL (model), &iter)) { gtk_tree_store_remove (GTK_TREE_STORE (model), &iter); } else { - g_hash_table_insert (model->priv->uids_table, + g_hash_table_insert ( + model->priv->uids_table, g_strdup (e_destination_get_contact_uid (destination)), GINT_TO_POINTER (list_refs + 1)); } @@ -182,10 +184,12 @@ e_contact_list_model_add_destination (EContactListModel *model, return NULL; } - dest_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->emails_table, - e_destination_get_email (destination))); + dest_refs = GPOINTER_TO_INT ( + g_hash_table_lookup (model->priv->emails_table, + e_destination_get_email (destination))); - g_hash_table_insert (model->priv->emails_table, + g_hash_table_insert ( + model->priv->emails_table, g_strdup (e_destination_get_email (destination)), GINT_TO_POINTER (dest_refs + 1)); @@ -225,16 +229,19 @@ contact_list_model_unref_row_dest (EContactListModel *model, if (gtk_tree_model_iter_has_child (tree_model, iter)) { GtkTreeIter child_iter; - gint list_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->uids_table, + gint list_refs = GPOINTER_TO_INT ( + g_hash_table_lookup (model->priv->uids_table, e_destination_get_contact_uid (dest))); /* If the list is only once in the model, then remove it from the hash table, * otherwise decrease the counter by one */ if (list_refs <= 1) { - g_hash_table_remove (model->priv->uids_table, + g_hash_table_remove ( + model->priv->uids_table, e_destination_get_contact_uid (dest)); } else { - g_hash_table_insert (model->priv->uids_table, + g_hash_table_insert ( + model->priv->uids_table, g_strdup (e_destination_get_contact_uid (dest)), GINT_TO_POINTER (list_refs - 1)); } @@ -246,14 +253,18 @@ contact_list_model_unref_row_dest (EContactListModel *model, } } else { - gint dest_refs = GPOINTER_TO_INT (g_hash_table_lookup (model->priv->emails_table, - e_destination_get_email (dest))); + gint dest_refs = GPOINTER_TO_INT ( + g_hash_table_lookup ( + model->priv->emails_table, + e_destination_get_email (dest))); if (dest_refs <= 1) { - g_hash_table_remove (model->priv->emails_table, + g_hash_table_remove ( + model->priv->emails_table, e_destination_get_email (dest)); } else { - g_hash_table_insert (model->priv->emails_table, + g_hash_table_insert ( + model->priv->emails_table, g_strdup (e_destination_get_email (dest)), GINT_TO_POINTER (dest_refs - 1)); } -- cgit v1.2.3