[gnome-maps/wip/jonasdn/storedRoute: 8/13] placeStore: Make getModelForPlaceType take an array



commit 7002cd4cdae904dd0023f3d0d54c3668e5ea79b5
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Thu Feb 12 20:44:49 2015 +0100

    placeStore: Make getModelForPlaceType take an array
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744425

 src/placeStore.js |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index 79c5d89..d7be32f 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -199,12 +199,18 @@ const PlaceStore = new Lang.Class({
         this._store();
     },
 
-    getModelForPlaceType: function(placeType) {
+    getModelForPlaceTypes: function(placeTypes) {
         let filter = new Gtk.TreeModelFilter({ child_model: this });
 
         filter.set_visible_func(function(model, iter) {
             let type = model.get_value(iter, Columns.TYPE);
-            return (type === placeType);
+            let found = false;
+
+            placeTypes.forEach(function(placeType) {
+                if (type === placeType)
+                    found = true;
+            });
+            return found;
         });
 
         return filter;


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