From 5cca30a877ea4b7c2c1e60aa8dc0b81ad41f3166 Mon Sep 17 00:00:00 2001 From: Erwann Chenede - Date: Mon, 15 Nov 2004 13:48:52 +0000 Subject: [PATCH] fix unselect in multiple selection (#156805) 2004-11-15 Erwann Chenede - * gtk/gtkfilesel.c: fix unselect in multiple selection (#156805) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gtk/gtkfilesel.c | 12 ++++++++++-- 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7db585b0ab..5287972495 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-11-15 Erwann Chenede - + + * gtk/gtkfilesel.c: fix unselect in multiple selection (#156805) + 2004-11-15 Matthias Clasen * gtk/gtklabel.c: Include gtkdnd.h (#158243, Kazuki IWAMOTO) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7db585b0ab..5287972495 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2004-11-15 Erwann Chenede - + + * gtk/gtkfilesel.c: fix unselect in multiple selection (#156805) + 2004-11-15 Matthias Clasen * gtk/gtklabel.c: Include gtkdnd.h (#158243, Kazuki IWAMOTO) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 7db585b0ab..5287972495 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +2004-11-15 Erwann Chenede - + + * gtk/gtkfilesel.c: fix unselect in multiple selection (#156805) + 2004-11-15 Matthias Clasen * gtk/gtklabel.c: Include gtkdnd.h (#158243, Kazuki IWAMOTO) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7db585b0ab..5287972495 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +2004-11-15 Erwann Chenede - + + * gtk/gtkfilesel.c: fix unselect in multiple selection (#156805) + 2004-11-15 Matthias Clasen * gtk/gtklabel.c: Include gtkdnd.h (#158243, Kazuki IWAMOTO) diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index bf6585dd9f..e75c96e55c 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -2456,8 +2456,7 @@ maybe_clear_entry: * * Retrieves the list of file selections the user has made in the dialog box. * This function is intended for use when the user can select multiple files - * in the file list. The first file in the list is equivalent to what - * gtk_file_selection_get_filename() would return. + * in the file list. * * The filenames are in the encoding of g_filename_from_utf8(), which may or * may not be the same as that used by GTK+ (UTF-8). To convert to UTF-8, call @@ -2500,6 +2499,15 @@ gtk_file_selection_get_selections (GtkFileSelection *filesel) { dirname = g_path_get_dirname (filename); + if ((names->len >= 1) && + (strcmp (gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)), "") == 0)) + { /* multiple files are selected and last selection was removed via ctrl click */ + g_free (dirname); + dirname = g_strdup (filename); /* as gtk_file_selection_get_filename returns dir + if no file is selected */ + unselected_entry = FALSE; + } + for (i = 0; i < names->len; i++) { buf = g_filename_from_utf8 (g_ptr_array_index (names, i), -1,