GNOME Bugzilla – Bug 593385
Spurious error "The folder could not be created" from gtkfilechooser
Last modified: 2011-02-19 19:10:42 UTC
Created attachment 141930 [details] minimal GTK program to expose bug I create a gtk file chooser dialog in directory *selection* mode, and set a default filename. The user clicks "OK" in the dialog without making any changes. The effect should be to select the pre-set default directory, but in fact an error is flagged, "The folder could not be created". This is on GTK+ 2.16.5. I'm attaching a minimal test program. (This may be related to bug 557689, but it doesn't appear to be the same, and the patch attached to the bug does not help with this one.)
I've been trying to track this down, and here's one relevant point. The bug is manifest in save_entry_get_info_cb(), in gtkfilechooserdefault.c. The structure of the code here is: if (parent_is_folder) { if (data->impl->action == GTK_FILE_CHOOSER_ACTION_SAVE) { /* code 1 */ } else /* GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER */ { /* code 2: wrong assumption! */ } } The comment "/* GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER */" is in the file, and seems to indicate that code 2 should be reached *only* if the action is to create a folder. But in fact it is reached for the select folder action under the circumstances given in my test program (click OK to select default path), in which case it triggers the spurious error.
Just checked to see if the changes in GTK 2.16.6 happened to fix this. The answer is No.
I'm not sure when, but this was fixed somewhere between GTK 2.16.6 and 2.24.