From 5aa450f97bcba05855364a24f1fe1050467729b6 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sat, 16 May 1998 07:22:00 +0000 Subject: [PATCH] g_strdup() the text retrived from GtkEntry. only intercept the Tab key if Sat May 16 09:04:32 1998 Tim Janik * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the text retrived from GtkEntry. only intercept the Tab key if there was some text to complete. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glib/gscanner.c | 1 + gtk/gtkfilesel.c | 14 ++++++++++++-- 9 files changed, 55 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5bc1fa0030..df4c69d7f2 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Sat May 16 09:04:32 1998 Tim Janik + + * gtk/gtkfilesel.c (gtk_file_selection_key_press): g_strdup() the + text retrived from GtkEntry. only intercept the Tab key if there + was some text to complete. + Fri May 15 21:16:54 1998 Owen Taylor Basic thread-awareness: diff --git a/glib/gscanner.c b/glib/gscanner.c index 665af00af9..529d7e76e0 100644 --- a/glib/gscanner.c +++ b/glib/gscanner.c @@ -27,6 +27,7 @@ #include #include #include +#include /* needed for sys/stat.h */ #include #include "glib.h" diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index beb906c21f..3f8181666f 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -1029,13 +1029,23 @@ gtk_file_selection_key_press (GtkWidget *widget, if (event->keyval == GDK_Tab) { - gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + gboolean intercept; fs = GTK_FILE_SELECTION (user_data); text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); + + intercept = text && *text; + + text = g_strdup (text); + gtk_file_selection_populate (fs, text, TRUE); - return TRUE; + g_free (text); + + if (intercept) + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event"); + + return intercept; } return FALSE;