GNOME Bugzilla – Bug 136235
Should not run file chooser dialog in a loop to enter folders
Last modified: 2004-12-22 21:47:04 UTC
Please see these: http://primates.ximian.com/~federico/news-2004-03.html#04 http://cvs.gnome.org/bonsai/cvsblame.cgi?file=nautilus-cd-burner/nautilus-cd-burner.c&rev=1.54&root=/cvs/gnome#586
I fixed this, but the entry in your diary isn't completely true. Its still true that you can type the name of an existing folder in the save dialog, and it'll gladly pick that name. Thats sort of strange.
I didn't make any guarantees in my entry ;) I guess the only thing we can really guarantee is that the "gimme filename" functions will not return an empty result. Consider ACTION_OPEN. We check the selection in the file list so that we are not returing what is obviously a directory, *but* this information is valid at the time when the listed folder was read. Between the time the test is made and the time you call get_filename() after gtk_dialog_run(), your program could be scheduled out and the file could have changed --- what was a folder could have been rmdir()ed, and a file with the same name could have been created in its place. For Save mode, the tests are less stringent. We only test that the entered filename is valid through the use of gtk_file_system_make_path(). I guess we could test whether the generated path name is known to be a folder, but again, this is not completely reliable by the time the client program gets the path name. We should perhaps discuss this in gtk-devel-list.