Update folks-import to the current API for ImDetails.im_addresses.
authorTravis Reitter <travis.reitter@collabora.co.uk>
Mon, 21 Mar 2011 17:42:40 +0000 (10:42 -0700)
committerTravis Reitter <travis.reitter@collabora.co.uk>
Tue, 22 Mar 2011 16:59:11 +0000 (09:59 -0700)
Fixes bgo#645411 - folks-import segfaults on startup

NEWS
tools/import-pidgin.vala

diff --git a/NEWS b/NEWS
index 1f3b7e0..4e5e220 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Bugs fixed:
   List<FieldDetails>
 * Bug 644527 - Add a Tracker backend
 * Bug 645430 - folks-inspect: Use LinkedHashSet to access im-addresses
+* Bug 645411 - folks-import segfaults on startup
 
 Overview of changes from libfolks 0.3.6 to libfolks 0.4.0
 =========================================================
index 01ed9ae..9493e70 100644 (file)
@@ -167,8 +167,8 @@ public class Folks.Importers.Pidgin : Folks.Importer
   private async Persona? parse_contact (Xml.Node *contact_node)
     {
       string alias = null;
-      HashTable<string, GenericArray<string>> im_addresses =
-          new HashTable<string, GenericArray<string>> (str_hash, str_equal);
+      HashTable<string, LinkedHashSet<string>> im_addresses =
+          new HashTable<string, LinkedHashSet<string>> (str_hash, str_equal);
       string im_address_string = "";
 
       /* Parse the <buddy> elements beneath <contact> */
@@ -203,15 +203,15 @@ public class Folks.Importers.Pidgin : Folks.Importer
                    * for the linking to work. */
                   string im_address = subiter->get_content ();
 
-                  GenericArray<string> im_address_array =
+                  LinkedHashSet<string> im_address_set =
                       im_addresses.lookup (tp_protocol);
-                  if (im_address_array == null)
+                  if (im_address_set == null)
                     {
-                      im_address_array = new GenericArray<string> ();
-                      im_addresses.insert (tp_protocol, im_address_array);
+                      im_address_set = new LinkedHashSet<string> ();
+                      im_addresses.insert (tp_protocol, im_address_set);
                     }
 
-                  im_address_array.add (im_address);
+                  im_address_set.add (im_address);
                   im_address_string += "    %s\n".printf (im_address);
                 }
             }