[gnome-maps] Add recent places from PlaceEntry



commit 7abbfdec4778631544054ca26dc86a3ab3a6c14e
Author: Jonas Danielsson <jonas danielsson threetimestwo org>
Date:   Fri Sep 5 05:52:40 2014 -0400

    Add recent places from PlaceEntry
    
    Move the adding of recent places to the PlaceEntry
    module. This will make places found using the route
    planner added to the store as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736107

 src/mainWindow.js |    1 -
 src/placeEntry.js |    5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index ece4127..885f5c6 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -100,7 +100,6 @@ const MainWindow = new Lang.Class({
         placeEntry.connect('notify::place', (function() {
             if (placeEntry.place) {
                 this.mapView.showSearchResult(placeEntry.place);
-                Application.placeStore.addRecent(placeEntry.place);
             }
         }).bind(this));
 
diff --git a/src/placeEntry.js b/src/placeEntry.js
index a995ff7..806db5f 100644
--- a/src/placeEntry.js
+++ b/src/placeEntry.js
@@ -54,9 +54,10 @@ const PlaceEntry = new Lang.Class({
         if (this._place && p && this._place.location.equals(p.location))
             return;
 
-        if (p)
+        if (p) {
             this.text = p.name;
-        else
+            Application.placeStore.addRecent(p);
+        } else
             this.text = '';
 
         this._place = p;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]