[folks/edsunittests] Use async addressbook remove method, since sync method hangs currently.



commit 95b63a26c301a997a1dcacb8143330c939a73f39
Author: Jeremy Whiting <jpwhiting kde org>
Date:   Thu Jun 21 12:36:27 2012 -0600

    Use async addressbook remove method, since sync method hangs currently.

 tests/lib/eds/backend.vala |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/tests/lib/eds/backend.vala b/tests/lib/eds/backend.vala
index afeac3e..8eab352 100644
--- a/tests/lib/eds/backend.vala
+++ b/tests/lib/eds/backend.vala
@@ -262,22 +262,24 @@ public class EdsTest.Backend
       Environment.set_variable ("FOLKS_BACKEND_EDS_USE_ADDRESS_BOOKS",
           "", true);
 
-      try
+        this._addressbook.remove.begin (null, (o, r) =>
         {
-          var ret = this._addressbook.remove_sync (null);
-          if (ret == false)
+          try
+          {
+            var ret = this._addressbook.remove.end (r);
+            if (ret == false)
             {
               GLib.warning ("remove() addressbook returned false on %s\n",
-                                  this._addressbook_name);
+              this._addressbook_name);
             }
-
-          this._addressbook = null;
-        }
-      catch (GLib.Error e)
-        {
-          GLib.warning ("Unable to remove addressbook %s because: %s\n",
-                              this._addressbook_name, e.message);
-        }
+            this._addressbook = null;
+          }
+          catch (GLib.Error e)
+          {
+            GLib.warning ("Unable to remove addressbook %s because: %s\n",
+            this._addressbook_name, e.message);
+          }
+          });
     }
 
   private Gee.HashMap<string, string> _parse_addrs (string addr_s)



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