[gnome-maps/wip/places: 1/6] mainWindow: use place in search model



commit 3ae0bc754b200f240f0b6fe9b821ee98a862c08a
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Mon Jan 13 08:40:21 2014 +0100

    mainWindow: use place in search model
    
    Use place instead of location in search model in order to keep
    as much information about the search results as possible.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722102

 src/mainWindow.js |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 034a57d..7b4ed28 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -49,7 +49,7 @@ const _PLACE_ICON_SIZE = 20;
 const SearchResults = {
     COL_ICON:         0,
     COL_DESCRIPTION:  1,
-    COL_LOCATION:     2
+    COL_PLACE:        2
 };
 
 const MainWindow = new Lang.Class({
@@ -217,9 +217,10 @@ const MainWindow = new Lang.Class({
 
     _onSearchPopupSelected: function(widget, iter) {
         let model = this._searchPopup.getModel();
-        let location = model.get_value(iter, SearchResults.COL_LOCATION);
+        let place = model.get_value(iter, SearchResults.COL_PLACE);
+
+        this.mapView.showNGotoLocation(place.location);
 
-        this.mapView.showNGotoLocation(location);
         this._searchPopup.hide();
     },
 
@@ -274,9 +275,9 @@ const MainWindow = new Lang.Class({
 
             model.set(iter,
                       [SearchResults.COL_DESCRIPTION,
-                       SearchResults.COL_LOCATION],
+                       SearchResults.COL_PLACE],
                       [description,
-                       location]);
+                       place]);
 
             if (icon !== null) {
                 Utils.load_icon(icon, _PLACE_ICON_SIZE, function(pixbuf) {


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