Chromium Code Reviews| Index: chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc |
| =================================================================== |
| --- chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc (revision 144492) |
| +++ chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc (working copy) |
| @@ -404,10 +404,16 @@ |
| // Since the file may not already exist, we use |
| // set_current_folder() followed by set_current_name(), as per the |
| // recommendation of the GTK docs. |
| - gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), |
| - default_path.DirName().value().c_str()); |
| - gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), |
| - default_path.BaseName().value().c_str()); |
| + if (CallDirectoryExistsOnUIThread(default_path)) { |
|
Evan Stade
2012/06/28 03:52:18
there has to be a way to do this without consultin
viettrungluu
2012/06/28 03:59:52
I agree that this is really awful (especially sinc
|
| + gtk_file_chooser_set_current_folder( |
| + GTK_FILE_CHOOSER(dialog), default_path.value().c_str()); |
| + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), ""); |
| + } else { |
| + gtk_file_chooser_set_current_folder( |
| + GTK_FILE_CHOOSER(dialog), default_path.DirName().value().c_str()); |
| + gtk_file_chooser_set_current_name( |
| + GTK_FILE_CHOOSER(dialog), default_path.BaseName().value().c_str()); |
| + } |
| } else if (!last_saved_path_->empty()) { |
| gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), |
| last_saved_path_->value().c_str()); |