[gnome-weather] SelectionToolbar: fix deleting multiple locations at once
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] SelectionToolbar: fix deleting multiple locations at once
- Date: Sat, 16 Mar 2013 00:03:32 +0000 (UTC)
commit 3380bb1f006a7b05c275f2f97656cbd6f55de44a
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sat Mar 16 01:00:42 2013 +0100
SelectionToolbar: fix deleting multiple locations at once
Deletion must happen in reverse order, because deleting causes all
subsequent paths to change meaning.
src/window.js | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/window.js b/src/window.js
index d08a815..fe52d77 100644
--- a/src/window.js
+++ b/src/window.js
@@ -59,11 +59,11 @@ const SelectionToolbar = new Lang.Class({
let items = this._worldView.get_selection();
let model = this._worldView.get_model();
- items.forEach(function(itemPath) {
- let [res, iter] = model.get_iter(itemPath);
+ for (let i = items.length - 1; i >= 0; i--) {
+ let [res, iter] = model.get_iter(items[i]);
if (res)
model.removeLocation(iter);
- });
+ }
}));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]