diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-10-20 19:12:00 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-11-03 15:45:23 +0800 |
commit | 56b38154b0c236a158a41989c0cc72e0302cf6ff (patch) | |
tree | ea65488c6657296a4178bc13f768c9fc8fb8a1eb /libempathy-gtk | |
parent | f8a787f1ad106cbb6422038800ee767c1b94a724 (diff) | |
download | gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.tar gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.tar.gz gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.tar.bz2 gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.tar.lz gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.tar.xz gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.tar.zst gsoc2013-empathy-56b38154b0c236a158a41989c0cc72e0302cf6ff.zip |
split filling of details_to_set and adding the widgets
This will allow us to add supported fields which are not set in the vCard.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index b73fd6642..c0a6b8226 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -313,21 +313,13 @@ contact_widget_details_update_edit (EmpathyContactWidget *information) connection = tp_contact_get_connection (contact); info = tp_contact_get_contact_info (contact); - info = g_list_sort (info, (GCompareFunc) contact_info_field_cmp); specs = tp_connection_get_contact_info_supported_fields (connection); + /* Look at the fields set in our vCard */ for (l = info; l != NULL; l = l->next) { TpContactInfoField *field = l->data; - InfoFieldData *field_data; - GtkWidget *w; - - field_data = find_info_field_data (field->field_name); - if (field_data == NULL) - { - DEBUG ("Unhandled ContactInfo field spec: %s", field->field_name); - } /* make a copy for the details_to_set list */ field = tp_contact_info_field_copy (field); @@ -335,12 +327,27 @@ contact_widget_details_update_edit (EmpathyContactWidget *information) information->details_to_set = g_list_prepend (information->details_to_set, field); + } + + /* Add widgets for supported fields */ + information->details_to_set = g_list_sort (information->details_to_set, + (GCompareFunc) contact_info_field_cmp); - /* Empathy doesn't display this field so we can't change it. But we put - * it in the details_to_set list so it won't be erased when calling - * SetContactInfo (bgo #630427) */ + for (l = information->details_to_set; l != NULL; l= g_list_next (l)) + { + TpContactInfoField *field = l->data; + InfoFieldData *field_data; + GtkWidget *w; + + field_data = find_info_field_data (field->field_name); if (field_data == NULL) - continue; + { + /* Empathy doesn't display this field so we can't change it. + * But we put it in the details_to_set list so it won't be erased + * when calling SetContactInfo (bgo #630427) */ + DEBUG ("Unhandled ContactInfo field spec: %s", field->field_name); + continue; + } /* Add Title */ w = gtk_label_new (_(field_data->title)); |