[gnome-maps/wip/favorites: 1/8] PlaceStore: Add getModelForPlaceType method
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/favorites: 1/8] PlaceStore: Add getModelForPlaceType method
- Date: Sat, 22 Nov 2014 00:17:51 +0000 (UTC)
commit a33ddc8b935fd26e80bb96c6743137246488c426
Author: rishirajsinghjhelumi <rishiakhnoor gmail com>
Date: Fri Nov 21 22:52:35 2014 +0100
PlaceStore: Add getModelForPlaceType method
src/placeStore.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index d35b425..4b1d9e4 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -154,6 +154,21 @@ 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);
+
+ if (type === placeType)
+ return true;
+ else
+ return false;
+ });
+
+ 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]