[gnome-maps/wip/favorites: 2/8] PlaceStore: Add removePlace method
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/favorites: 2/8] PlaceStore: Add removePlace method
- Date: Sat, 22 Nov 2014 00:17:56 +0000 (UTC)
commit c76ab8edf5946e1e9c79ab2b698f90fad0303794
Author: rishirajsinghjhelumi <rishiakhnoor gmail com>
Date: Fri Nov 21 22:54:47 2014 +0100
PlaceStore: Add removePlace method
src/placeStore.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index 4b1d9e4..204583a 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -154,6 +154,21 @@ const PlaceStore = new Lang.Class({
}
},
+ removePlace: function(place, placeType) {
+ if (!this.exists(place.osm_id, placeType))
+ return;
+
+ this._removeIf((function(model, iter) {
+ let p = model.get_value(iter, Columns.PLACE);
+ if (p.osm_id === place.osm_id) {
+ this._typeTable[place.osm_id] = null;
+ return true;
+ }
+ return false;
+ }).bind(this), true);
+ this._store();
+ },
+
getModelForPlaceType: function(placeType) {
let filter = new Gtk.TreeModelFilter({ child_model: this });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]