After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 593385 - Spurious error "The folder could not be created" from gtkfilechooser
Spurious error "The folder could not be created" from gtkfilechooser
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-08-28 13:48 UTC by Allin Cottrell
Modified: 2011-02-19 19:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
minimal GTK program to expose bug (1.55 KB, text/x-c)
2009-08-28 13:48 UTC, Allin Cottrell
Details

Description Allin Cottrell 2009-08-28 13:48:18 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.)
Comment 1 Allin Cottrell 2009-08-28 15:33:54 UTC
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.
Comment 2 Allin Cottrell 2009-08-29 19:05:24 UTC
Just checked to see if the changes in GTK 2.16.6 happened to
fix this.  The answer is No.
Comment 3 Allin Cottrell 2011-02-19 19:10:42 UTC
I'm not sure when, but this was fixed somewhere between
GTK 2.16.6 and 2.24.