aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-24 17:15:17 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-29 17:00:51 +0800
commite5bf164997d4580ae94fc1f2471a3bce6ac617b8 (patch)
tree29a03a00ecf2b2479a8e46545c7264e1f8ecee8a /libempathy-gtk
parentc58139d810f6fc2b52637ae19839b92c3063bb78 (diff)
downloadgsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.tar
gsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.tar.gz
gsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.tar.bz2
gsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.tar.lz
gsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.tar.xz
gsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.tar.zst
gsoc2013-empathy-e5bf164997d4580ae94fc1f2471a3bce6ac617b8.zip
Use tp_contact_info_field_copy() instead of creating a new field if found
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 3206af44b..f20ec81c4 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -293,7 +293,6 @@ contact_widget_details_update_edit (EmpathyContactWidget *information)
TpContactInfoField *field;
InfoFieldData *field_data;
GList *ll;
- GStrv value = NULL;
GtkWidget *w;
field_data = find_info_field_data (spec->name);
@@ -308,13 +307,20 @@ contact_widget_details_update_edit (EmpathyContactWidget *information)
{
field = ll->data;
if (!tp_strdiff (field->field_name, spec->name))
- {
- value = field->field_value;
- break;
- }
+ break;
+ }
+
+ if (field != NULL)
+ {
+ /* We found the field, make a copy for the details_to_set list */
+ field = tp_contact_info_field_copy (field);
+ }
+ else
+ {
+ field = tp_contact_info_field_new (spec->name, spec->parameters,
+ NULL);
}
- field = tp_contact_info_field_new (spec->name, spec->parameters, value);
information->details_to_set = g_list_prepend (information->details_to_set,
field);