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



commit 105a1c70451429ab2e5305eab9def4d164984f95
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 1a2d664..66ba34e 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Overview of changes from libfolks 0.4.1 to libfolks 0.4.2
 
 Bugs fixed:
 * Bug 645430 â?? folks-inspect: Use LinkedHashSet to access im-addresses
+* Bug 645411 â?? folks-import segfaults on startup
 
 Overview of changes from libfolks 0.4.0 to libfolks 0.4.1
 =========================================================
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]