Append a '/' to directory names in the completion popup. (#431323, Maarten

2007-04-26  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserentry.c: Append a '/' to directory names
        in the completion popup.  (#431323, Maarten Maathuis)



svn path=/trunk/; revision=17658
This commit is contained in:
Matthias Clasen 2007-04-26 17:04:33 +00:00 committed by Matthias Clasen
parent 790b009703
commit 069d78ed31
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2007-04-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilechooserentry.c: Append a '/' to directory names
in the completion popup. (#431323, Maarten Maathuis)
2007-04-26 Matthias Clasen <mclasen@redhat.com>
* demo/gtk-demo/combobox.c: Add a simple validation demo.

View File

@ -359,7 +359,7 @@ maybe_append_separator_to_path (GtkFileChooserEntry *chooser_entry,
GtkFilePath *path,
gchar *display_name)
{
if (path)
if (!g_str_has_suffix (display_name, G_DIR_SEPARATOR_S) && path)
{
GtkFileInfo *info;
@ -377,7 +377,6 @@ maybe_append_separator_to_path (GtkFileChooserEntry *chooser_entry,
gtk_file_info_free (info);
}
}
return display_name;
@ -572,9 +571,11 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry,
NULL); /* NULL-GError */
if (info)
{
const gchar *display_name = gtk_file_info_get_display_name (info);
gchar *display_name = g_strdup (gtk_file_info_get_display_name (info));
GtkTreeIter iter;
display_name = maybe_append_separator_to_path (chooser_entry, path, display_name);
gtk_list_store_append (chooser_entry->completion_store, &iter);
gtk_list_store_set (chooser_entry->completion_store, &iter,
DISPLAY_NAME_COLUMN, display_name,
@ -582,6 +583,7 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry,
-1);
gtk_file_info_free (info);
g_free (display_name);
}
}