summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooserdefault.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2010-10-05 14:41:51 -0500
committerFederico Mena Quintero <federico@novell.com>2010-10-05 15:35:31 -0500
commit1d21668ecc61e5ec89a8d57d13c56969c0d182f8 (patch)
tree8c2ee9cf4b68ef79e12dd393b76e40b879843889 /gtk/gtkfilechooserdefault.c
parentf7a20e35c17bc82bb1fbd92d362ab5caacc0e80f (diff)
downloadgtk+-1d21668ecc61e5ec89a8d57d13c56969c0d182f8.tar.gz
Handle the case where you type /blah/nonexistent in SELECT_FOLDER mode
Previously name_entry_get_parent_info_cb() would fail as it doesn't handle SELECT_FOLDER. Now we just make that function act the same as for CREATE_FOLDER mode. In either case, if you type "/blah/nonexistent" and hit Enter, you want a folder with that name to be created (under the already-existing /blah). Signed-off-by: Federico Mena Quintero <federico@novell.com>
Diffstat (limited to 'gtk/gtkfilechooserdefault.c')
-rw-r--r--gtk/gtkfilechooserdefault.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 9fceb8aa70..c0aad3e7f7 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -8185,10 +8185,15 @@ name_entry_get_parent_info_cb (GCancellable *cancellable,
else
g_signal_emit_by_name (data->impl, "response-requested");
}
- else if (data->impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+ else if (data->impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
+ || data->impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
{
GError *error = NULL;
+ /* In both cases (SELECT_FOLDER and CREATE_FOLDER), if you type
+ * "/blah/nonexistent" you *will* want a folder created.
+ */
+
set_busy_cursor (data->impl, TRUE);
g_file_make_directory (data->file, NULL, &error);
set_busy_cursor (data->impl, FALSE);