aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-list-editor
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-11-10 11:40:00 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-11-11 04:54:43 +0800
commit2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch)
treec34f0cbb7c500ff70f10fce846631b0a948b341c /addressbook/gui/contact-list-editor
parent583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff)
downloadgsoc2013-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 'addressbook/gui/contact-list-editor')
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c32
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c37
2 files changed, 43 insertions, 26 deletions
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));
}