[gnome-initial-setup/gbsneto/timezone-regressions: 2/2] timezone: Manually unset location field




commit 5f877548289a28e7113b4c5f20f77ed40c967c5a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Aug 15 10:53:24 2022 -0300

    timezone: Manually unset location field
    
    Instead of calling set_location_internal() from entry_changed(),
    which can lead to reentrancy issues, just manually clear the
    'location' field, and manually notify the 'location' property.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/issues/145

 gnome-initial-setup/pages/timezone/gis-location-entry.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/pages/timezone/gis-location-entry.c 
b/gnome-initial-setup/pages/timezone/gis-location-entry.c
index 7aec073f..b7119d9c 100644
--- a/gnome-initial-setup/pages/timezone/gis-location-entry.c
+++ b/gnome-initial-setup/pages/timezone/gis-location-entry.c
@@ -325,8 +325,11 @@ entry_changed (GisLocationEntry *entry)
 
     text = gtk_editable_get_text (GTK_EDITABLE (entry));
 
-    if (!text || *text == '\0')
-        set_location_internal (entry, NULL, NULL, NULL);
+    if (!text || *text == '\0') {
+        g_clear_object (&entry->priv->location);
+        gtk_editable_set_position (GTK_EDITABLE (entry), -1);
+        g_object_notify (G_OBJECT (entry), "location");
+    }
 }
 
 static void


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