diff options
author | António Fernandes <antoniof@gnome.org> | 2022-07-20 16:03:18 +0200 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-07-20 16:03:18 +0200 |
commit | 3d1c13915e73dde84ecc4ac44169a573d7ac8be8 (patch) | |
tree | bae045111928a57136864c7226dbd46c8885019c | |
parent | 1d431d186512a4d5e56eea45d24bdd0c0bd8e104 (diff) | |
download | nautilus-3d1c13915e73dde84ecc4ac44169a573d7ac8be8.tar.gz |
location-entry: Simplify contrived special text code
It's overly complicated for no reason. Also add a comment to explain
what's the point of it all.
-rw-r--r-- | src/nautilus-location-entry.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c index aca4c6e1b..fa516afe7 100644 --- a/src/nautilus-location-entry.c +++ b/src/nautilus-location-entry.c @@ -56,8 +56,6 @@ typedef struct _NautilusLocationEntryPrivate GFile *last_location; gboolean has_special_text; - gboolean setting_special_text; - gchar *special_text; NautilusLocationEntryAction secondary_action; GtkEventController *controller; @@ -464,11 +462,10 @@ on_has_focus_changed (GObject *object, entry = NAUTILUS_LOCATION_ENTRY (object); priv = nautilus_location_entry_get_instance_private (entry); + /* The entry has text which is not worth preserving on focus-in. */ if (priv->has_special_text) { - priv->setting_special_text = TRUE; nautilus_location_entry_set_text (entry, ""); - priv->setting_special_text = FALSE; } } @@ -480,11 +477,6 @@ nautilus_location_entry_text_changed (NautilusLocationEntry *entry, priv = nautilus_location_entry_get_instance_private (entry); - if (priv->setting_special_text) - { - return; - } - priv->has_special_text = FALSE; } @@ -849,12 +841,6 @@ nautilus_location_entry_set_special_text (NautilusLocationEntry *entry, priv = nautilus_location_entry_get_instance_private (entry); - priv->has_special_text = TRUE; - - g_free (priv->special_text); - priv->special_text = g_strdup (special_text); - - priv->setting_special_text = TRUE; nautilus_location_entry_set_text (entry, special_text); - priv->setting_special_text = FALSE; + priv->has_special_text = TRUE; } |