[gnome-maps/wip/favorites: 3/9] PlaceStore: Add removePlace method
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/favorites: 3/9] PlaceStore: Add removePlace method
- Date: Sat, 22 Nov 2014 19:22:37 +0000 (UTC)
commit 3442a9473cec93990ec2b121ba8b0ff07209058e
Author: rishirajsinghjhelumi <rishiakhnoor gmail com>
Date: Fri Nov 21 22:54:47 2014 +0100
PlaceStore: Add removePlace method
https://bugzilla.gnome.org/show_bug.cgi?id=722102
https://bugzilla.gnome.org/show_bug.cgi?id=728117
src/placeStore.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index e71297d..43e0367 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]