[gnome-maps/wip/favorites: 2/9] PlaceStore: Add getModelForPlaceType method
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/favorites: 2/9] PlaceStore: Add getModelForPlaceType method
- Date: Sat, 22 Nov 2014 12:42:13 +0000 (UTC)
commit a022db098ed8354b40abce2da1d4c37f573d1395
Author: rishirajsinghjhelumi <rishiakhnoor gmail com>
Date: Fri Nov 21 22:52:35 2014 +0100
PlaceStore: Add getModelForPlaceType method
https://bugzilla.gnome.org/show_bug.cgi?id=722102
src/placeStore.js | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index d35b425..e71297d 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -154,6 +154,17 @@ const PlaceStore = new Lang.Class({
}
},
+ getModelForPlaceType: function(placeType) {
+ 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);
+ });
+
+ return filter;
+ },
+
_store: function() {
let jsonArray = [];
this.foreach(function(model, path, iter) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]