diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-09 22:02:58 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-03-15 16:28:41 +0800 |
commit | a15866686e0851f4951144f0d7a6118e963b605d (patch) | |
tree | 0461d4fbcacbd4db7f34c1341a6583152a4d3e38 | |
parent | 4ac942f53ca44bcfc1e3b8aa9329dddf014b44b8 (diff) | |
download | gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.tar gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.tar.gz gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.tar.bz2 gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.tar.lz gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.tar.xz gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.tar.zst gsoc2013-empathy-a15866686e0851f4951144f0d7a6118e963b605d.zip |
factor out add_contact_to_store
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index f3e9a4b9e..21593932f 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -1020,6 +1020,27 @@ contact_list_store_groups_changed_cb (EmpathyContactList *list_iface, } static void +add_contact_to_store (GtkTreeStore *store, + GtkTreeIter *iter, + EmpathyContact *contact, + EmpathyContactListFlags flags) +{ + gtk_tree_store_set (store, iter, + EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_name (contact), + EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact, + EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE, + EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE, + EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL, + empathy_contact_get_capabilities (contact) & + EMPATHY_CAPABILITIES_AUDIO, + EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL, + empathy_contact_get_capabilities (contact) & + EMPATHY_CAPABILITIES_VIDEO, + EMPATHY_CONTACT_LIST_STORE_COL_FLAGS, flags, + -1); +} + +static void contact_list_store_add_contact (EmpathyContactListStore *store, EmpathyContact *contact) { @@ -1077,19 +1098,7 @@ contact_list_store_add_contact (EmpathyContactListStore *store, gtk_tree_store_append (GTK_TREE_STORE (store), &iter, NULL); #endif - gtk_tree_store_set (GTK_TREE_STORE (store), &iter, - EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_name (contact), - EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact, - EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE, - EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE, - EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL, - empathy_contact_get_capabilities (contact) & - EMPATHY_CAPABILITIES_AUDIO, - EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL, - empathy_contact_get_capabilities (contact) & - EMPATHY_CAPABILITIES_VIDEO, - EMPATHY_CONTACT_LIST_STORE_COL_FLAGS, flags, - -1); + add_contact_to_store (GTK_TREE_STORE (store), &iter, contact, flags); } /* Else add to each group. */ @@ -1100,19 +1109,8 @@ contact_list_store_add_contact (EmpathyContactListStore *store, gtk_tree_store_insert_after (GTK_TREE_STORE (store), &iter, &iter_group, NULL); - gtk_tree_store_set (GTK_TREE_STORE (store), &iter, - EMPATHY_CONTACT_LIST_STORE_COL_NAME, empathy_contact_get_name (contact), - EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, contact, - EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, FALSE, - EMPATHY_CONTACT_LIST_STORE_COL_IS_SEPARATOR, FALSE, - EMPATHY_CONTACT_LIST_STORE_COL_CAN_AUDIO_CALL, - empathy_contact_get_capabilities (contact) & - EMPATHY_CAPABILITIES_AUDIO, - EMPATHY_CONTACT_LIST_STORE_COL_CAN_VIDEO_CALL, - empathy_contact_get_capabilities (contact) & - EMPATHY_CAPABILITIES_VIDEO, - EMPATHY_CONTACT_LIST_STORE_COL_FLAGS, flags, - -1); + + add_contact_to_store (GTK_TREE_STORE (store), &iter, contact, flags); g_free (l->data); } g_list_free (groups); |