[gnome-maps] Search asynchronously



commit 928b4afcd3610d2b9394eb63290f69224b5e3de5
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Mar 25 20:26:14 2013 +0200

    Search asynchronously

 src/mainToolbar.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 88a4157..d7ea207 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -57,15 +57,19 @@ const MainToolbar = new Lang.Class({
         let forward = Geocode.Forward.new_for_string(str);
         this._markerLayer.remove_all();
 
+
+        forward.search_async (null, Lang.bind(this, this._onSearchComplete));
+    },
+
+    _onSearchComplete: function(forward, res) {
         let locations = [];
 
         try {
-            locations = forward.search ();
+            locations = forward.search_finish(res);
         } catch (e) {
             log ("Failed to search '" + str + "': " + e.message);
             return;
         }
-
         log (locations.length + " locations found");
         if (locations.length == 0)
             return;


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