[gnome-maps] placeStore: Add get method



commit e844a007324a88306a2c69b90dd48ba9435f670f
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Thu Nov 13 01:55:00 2014 -0500

    placeStore: Add get method
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726625

 src/placeStore.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index fbe5081..3ed17dc 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -192,6 +192,19 @@ const PlaceStore = new Lang.Class({
         this._typeTable[place.osm_id] = type;
     },
 
+    get: function(osmId) {
+        let place = null;
+        this.foreach(function(model, path, iter) {
+            let p = model.get_value(iter, Columns.PLACE);
+            if (p.osm_id === osmId) {
+                place = p;
+                return true;
+            }
+            return false;
+        });
+        return place;
+    },
+
     exists: function(osmId, type) {
         if (type)
             return this._typeTable[osmId] === type;


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