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 351063 - Overwrite confirmation does not appear if file not selected in list
Overwrite confirmation does not appear if file not selected in list
Status: RESOLVED DUPLICATE of bug 347883
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2006-08-12 17:25 UTC by Gustavo Carneiro
Modified: 2006-08-14 16:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gustavo Carneiro 2006-08-12 17:25:43 UTC
In gtk+ FileChooser, in save mode, I call set_do_overwrite_confirmation(True).  Now the file chooser confirms overwrite only when I activate a row in the treeview widget.  It doesn't give the least warning if I _type_ a file name equal to an existing file and press enter with the gtk.Entry having focus.
Comment 1 Gustavo Carneiro 2006-08-12 22:07:16 UTC
The bug seems to be around function gtk_file_chooser_default_should_respond in gtkfilechooserdefault.c:

Around line 7565 there's:

      check_save_entry (impl, &path, &is_well_formed, &is_empty, &is_file_part_empty, &is_folder);

      if (is_empty || !is_well_formed)
	return FALSE;

      g_assert (path != NULL);

      error = NULL;
      if (is_folder)
	{
           [...]
	}
      else
	{
	  gboolean file_exists_and_is_not_folder;

	  file_exists_and_is_not_folder = g_error_matches (error, GTK_FILE_SYSTEM_ERROR, GTK_FILE_SYSTEM_ERROR_NOT_FOLDER);

Clearly there's something missing here.  check_save_entry() appears to do a file test, among other things.  Then we have 'error = NULL', followed by an if (is_folder); the file is not a folder, so the else branch is executed, containing:
    file_exists_and_is_not_folder = g_error_matches (error, GTK_FILE_SYSTEM_ERROR, GTK_FILE_SYSTEM_ERROR_NOT_FOLDER);

But error is always NULL, so file_exists_and_is_not_folder is always FALSE.  I don't know the original code, but I suspect error should have been set by check_save_entry before some code refactoring that went wrong.
Comment 2 Federico Mena Quintero 2006-08-14 16:38:39 UTC
Yeah, that code got broken with the changes to make the file chooser asynchronous.  We have a test in autotestfilechooser; I need to finish fixing the bug :)

[It's partly an API problem with GtkFileChooserEntry - fortunately we can change it since it's only an internal widget.]

*** This bug has been marked as a duplicate of 347883 ***