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 382479 - gtk_file_chooser_set_current_folder() returns TRUE and causes error popup when path doesn't exist
gtk_file_chooser_set_current_folder() returns TRUE and causes error popup whe...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
filechooser-windows-testing-needed
: 432904 436429 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-12-05 04:16 UTC by Daniel Atallah
Modified: 2018-05-02 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Atallah 2006-12-05 04:16:40 UTC
According to the docs for gtk_file_chooser_set_current_folder(), it will return FALSE if the folder couldn't be changed successfully.  The function currently returns TRUE if the new folder doesn't exist.  I'm not sure if this may be by design; it will fall back to the parent directory and eventually the root directory, but I believe that it should still return FALSE because it didn't set the requested directory. If this is the desired behavior, when would the function actually return FALSE?

In addition to this (and more importantly), a blocking error dialog which says "The folder contents could not be displayed" is displayed.  The detail text is "Error getting information for '/usr/nonexistent': The system cannot find the path specified."  Until this dialog is dismissed, the main loop will not be iterated.

This can easily be recreated with testfilechooser.exe from gtk+/tests by simply clicking on the 'set_current_folder("/usr/nonexistent")' button.
Comment 1 Timothy Arceri 2013-06-04 22:01:50 UTC
Probably related to bug 436429
Comment 2 Daniel Boles 2017-08-07 14:43:08 UTC
*** Bug 436429 has been marked as a duplicate of this bug. ***
Comment 3 Daniel Boles 2017-08-07 14:45:29 UTC
Yes, both _folder() and _folder_uri() return the result of IFACE->get_current_folder() via set_current_folder_file()
Comment 4 Daniel Boles 2017-08-07 14:49:31 UTC
which in the common case, ultimately returns the result of gtk_file_chooser_widget_update_current_folder() - and that just unconditionally returns TRUE... with only the following comment to hint at a better way:

> [5601] /* Test validity of path here.  */


(In reply to Daniel Atallah from comment #0)
> [...] but I believe that it should still return
> FALSE because it didn't set the requested directory. If this is the desired
> behavior, when would the function actually return FALSE?

It does return false if :local-only is TRUE and you try to set a non-local path. But obviously that is not sufficient.
Comment 5 Bastien Nocera 2018-02-13 15:56:26 UTC
*** Bug 432904 has been marked as a duplicate of this bug. ***
Comment 6 GNOME Infrastructure Team 2018-05-02 14:24:19 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/273.