[gnome-software: 97/110] gs-shell: Use a copy of the search entry's text




commit a1b92d9f117c6da2b47d9905e6d18cc80b542122
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Aug 27 17:40:25 2021 -0300

    gs-shell: Use a copy of the search entry's text
    
    Otherwise, for some reason, it keeps resetting search.

 src/gs-shell.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 3dd62d7a1..e7be3f011 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -946,9 +946,9 @@ window_keypress_handler (GtkEventControllerKey *key_controller,
 static void
 search_changed_handler (GObject *entry, GsShell *shell)
 {
-       const gchar *text;
+       g_autofree gchar *text = NULL;
 
-       text = gtk_editable_get_text (GTK_EDITABLE (entry));
+       text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
        if (strlen (text) >= 2) {
                if (gs_shell_get_mode (shell) != GS_SHELL_MODE_SEARCH) {
                        save_back_entry (shell);


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