From 7cd0c2686dbcc2fe318e78d99d7b53cde621b2a4 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Mon, 15 Mar 2004 23:15:31 +0000 Subject: Only hide the "create folder" button in OPEN mode; all the others should 2004-03-15 Federico Mena Quintero * gtk/gtkfilechooserdefault.c (update_appearance): Only hide the "create folder" button in OPEN mode; all the others should show it it. (get_paths_foreach): Handle the editable row. * gtk/gtkfilesystemunix.c (gtk_file_system_unix_create_folder): Force a re-get of the folder so that the new directory gets added to its hash table of file info. --- gtk/gtkfilesystemunix.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'gtk/gtkfilesystemunix.c') diff --git a/gtk/gtkfilesystemunix.c b/gtk/gtkfilesystemunix.c index 5a6d6cf0b0..01528ce533 100644 --- a/gtk/gtkfilesystemunix.c +++ b/gtk/gtkfilesystemunix.c @@ -501,12 +501,31 @@ gtk_file_system_unix_create_folder (GtkFileSystem *file_system, folder_unix = g_hash_table_lookup (system_unix->folder_hash, parent); if (folder_unix) { + GtkFileInfoType types; + GtkFilePath *parent_path; GSList *paths; + GtkFileFolder *folder; - paths = g_slist_append (NULL, (GtkFilePath *) path); - g_signal_emit_by_name (folder_unix, "files-added", paths); - g_slist_free (paths); + /* This is sort of a hack. We re-get the folder, to ensure that the + * newly-created directory gets read into the folder's info hash table. + */ + + types = folder_unix->types; + + parent_path = gtk_file_path_new_dup (parent); + folder = gtk_file_system_get_folder (file_system, parent_path, types, NULL); + gtk_file_path_free (parent_path); + + if (folder) + { + paths = g_slist_append (NULL, (GtkFilePath *) path); + g_signal_emit_by_name (folder, "files-added", paths); + g_slist_free (paths); + g_object_unref (folder); + } } + + g_free (parent); } return TRUE; -- cgit v1.2.1