[gtk+/gtk-2-22] Handle the case where you type /blah/nonexistent in SELECT_FOLDER mode



commit addd63777d95b16297caa48379500ea1a334e0d8
Author: Federico Mena Quintero <federico novell com>
Date:   Tue Oct 5 14:41:51 2010 -0500

    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>
    (cherry picked from commit 09cf709fe9bf01f043ba3f3444dcb2513370d2c0)

 gtk/gtkfilechooserdefault.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index e8078a9..1a8b461 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -8361,10 +8361,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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]