[gnome-maps] sendToDialog: Do not show title for current location



commit bed49360859e7e8e62df7f46451f096920518bd6
Author: James Westman <flyingpimonster flyingpimonster net>
Date:   Mon Jun 10 14:56:42 2019 -0500

    sendToDialog: Do not show title for current location
    
    Part of the share dialog overhaul, #167.

 src/geoclue.js      | 3 ++-
 src/place.js        | 7 +++++++
 src/sendToDialog.js | 3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/geoclue.js b/src/geoclue.js
index cb7b0f5..65fd7ec 100644
--- a/src/geoclue.js
+++ b/src/geoclue.js
@@ -115,7 +115,8 @@ var Geoclue = GObject.registerClass({
 
     _updateLocation(location) {
         if (!this.place)
-            this.place = new Place.Place({ name: _("Current location") });
+            this.place = new Place.Place({ name: _("Current location"),
+                                           isCurrentLocation: true });
 
         this.place.location = location;
         this.emit('location-changed');
diff --git a/src/place.js b/src/place.js
index a5b52f9..3a28423 100644
--- a/src/place.js
+++ b/src/place.js
@@ -42,6 +42,9 @@ var Place = GObject.registerClass(
 class Place extends Geocode.Place {
 
     _init(params) {
+        this._isCurrentLocation = params.isCurrentLocation;
+        delete params.isCurrentLocation;
+
         this._population = params.population;
         delete params.population;
 
@@ -119,6 +122,10 @@ class Place extends Geocode.Place {
         return this.osm_type + '-' + this.osm_id;
     }
 
+    get isCurrentLocation() {
+        return this._isCurrentLocation;
+    }
+
     set population(v) {
         this._population = v;
     }
diff --git a/src/sendToDialog.js b/src/sendToDialog.js
index 7780980..2bbf855 100644
--- a/src/sendToDialog.js
+++ b/src/sendToDialog.js
@@ -149,7 +149,8 @@ var SendToDialog = GObject.registerClass({
 
         let formatter = new PlaceFormatter.PlaceFormatter(place);
 
-        lines.push(formatter.title);
+        if (!place.isCurrentLocation)
+            lines.push(formatter.title);
 
         let details = formatter.getDetailsString();
         if (details) {


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