[folks] Update folks-import to the current API for ImDetails.im_addresses.



commit 86f6bf68706af4534b5022d0f8a939b40627d277
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Mar 21 10:42:40 2011 -0700

    Update folks-import to the current API for ImDetails.im_addresses.
    
    Fixes bgo#645411 - folks-import segfaults on startup

 NEWS                     |    1 +
 tools/import-pidgin.vala |   14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/NEWS b/NEWS
index 1f3b7e0..4e5e220 100644
--- 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
 =========================================================
diff --git a/tools/import-pidgin.vala b/tools/import-pidgin.vala
index 01ed9ae..9493e70 100644
--- a/tools/import-pidgin.vala
+++ b/tools/import-pidgin.vala
@@ -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);
                 }
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]