]> git.0d.be Git - empathy.git/commitdiff
Use tp_contact_info_field_copy() instead of creating a new field if found
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 24 Sep 2010 09:15:17 +0000 (11:15 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 29 Sep 2010 09:00:51 +0000 (11:00 +0200)
libempathy-gtk/empathy-contact-widget.c

index 3206af44b07dab261370dfdf0442bcc381f67fba..f20ec81c49282b1612ba72a6ce589cf6d3acef32 100644 (file)
@@ -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);