[libgweather] GWeatherLocationEntry: reset the location when the entry is cleared



commit a8dea8263d38a40cc5ad479fa4d2fa26beea94f2
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Mon Feb 17 22:01:27 2014 +0100

    GWeatherLocationEntry: reset the location when the entry is cleared
    
    Clearing the entry (with the icon or by editing) is a clear sign
    that the user does not like the currently chosen location, so
    we should clear it.

 libgweather/location-entry.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/libgweather/location-entry.c b/libgweather/location-entry.c
index 55f469e..7b85df8 100644
--- a/libgweather/location-entry.c
+++ b/libgweather/location-entry.c
@@ -255,7 +255,14 @@ get_property (GObject *object, guint prop_id,
 static void
 entry_changed (GWeatherLocationEntry *entry)
 {
-    entry->priv->custom_text = TRUE;
+    const gchar *text;
+
+    text = gtk_entry_get_text (GTK_ENTRY (entry));
+
+    if (text && *text)
+       entry->priv->custom_text = TRUE;
+    else
+       set_location_internal (entry, NULL, NULL, NULL);
 }
 
 static void


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