summaryrefslogtreecommitdiff
path: root/src/routeQuery.js
diff options
context:
space:
mode:
authorJonas Danielsson <jonas@threetimestwo.org>2016-02-29 09:51:28 +0100
committerJonas Danielsson <jonas@threetimestwo.org>2016-02-29 09:51:28 +0100
commitf4cdc1848dc7e96fbd9bc0ed383e64ca8394d9f6 (patch)
treeddb6cfa93ce8c1202a51ef485c1d268b9ffa06bb /src/routeQuery.js
parenteb803a1ba44b1b30e5dd695b803ae4d5d668e7eb (diff)
downloadgnome-maps-f4cdc1848dc7e96fbd9bc0ed383e64ca8394d9f6.tar.gz
routeQuery: Add new places to placeStore
Diffstat (limited to 'src/routeQuery.js')
-rw-r--r--src/routeQuery.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/routeQuery.js b/src/routeQuery.js
index 21084405..4ae8264b 100644
--- a/src/routeQuery.js
+++ b/src/routeQuery.js
@@ -23,6 +23,9 @@ const GObject = imports.gi.GObject;
const Geocode = imports.gi.GeocodeGlib;
const Lang = imports.lang;
+const Application = imports.application;
+const PlaceStore = imports.placeStore;
+
const Transportation = {
CAR: 0,
BIKE: 1,
@@ -119,6 +122,13 @@ const RouteQuery = new Lang.Class({
this._points.splice(index, 0, point);
point.connect('notify::place', (function() {
+ let placeStore = Application.placeStore;
+ if (point.place) {
+ if (!placeStore.exists(point.place, null)) {
+ placeStore.addPlace(point.place,
+ PlaceStore.PlaceType.RECENT);
+ }
+ }
this.notify('points');
}).bind(this));
this.notify('points');