[gnome-maps/wip/mlundblad/simplify-place-init: 2/2] storedRoute: Initiate Place directly
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/simplify-place-init: 2/2] storedRoute: Initiate Place directly
- Date: Thu, 29 Oct 2020 09:40:51 +0000 (UTC)
commit 4cefeaac0105641e3237b0bd838301434fa891df
Author: Marcus Lundblad <ml update uu se>
Date: Thu Oct 29 10:38:46 2020 +0100
storedRoute: Initiate Place directly
src/storedRoute.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/storedRoute.js b/src/storedRoute.js
index b9e0bc85..de4b404a 100644
--- a/src/storedRoute.js
+++ b/src/storedRoute.js
@@ -52,7 +52,7 @@ class StoredRoute extends Place.Place {
this._rtl = Gtk.get_locale_direction() === Gtk.TextDirection.RTL;
- let places = params.places;
+ this.places = params.places;
delete params.places;
let directionMarker = this._rtl ? _RLM : _LRM;
let arrow = this._rtl ? '←' : '→';
@@ -63,18 +63,15 @@ class StoredRoute extends Place.Place {
let geoclue = params.geoclue;
delete params.geoclue;
- this.places = [];
this._containsCurrentLocation = false;
let currentLocation = null;
if (geoclue)
currentLocation = geoclue.place;
- places.forEach((place) => {
+ this.places.forEach((place) => {
if (currentLocation && place === currentLocation)
this._containsCurrentLocation = true;
-
- this.places.push(new Place.Place({ place: place }));
});
super._init(params);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]