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 360131 - Wronng documentation for gtk_file_chooser_set_do_overwrite_confirmation
Wronng documentation for gtk_file_chooser_set_do_overwrite_confirmation
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2006-10-06 11:37 UTC by Iago Toral
Modified: 2013-05-26 04:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Update doco (1.12 KB, patch)
2013-05-20 21:58 UTC, Timothy Arceri
none Details | Review
Update doco (1.13 KB, patch)
2013-05-20 22:37 UTC, Timothy Arceri
none Details | Review

Description Iago Toral 2006-10-06 11:37:07 UTC
Documentation 
Section: gtk-doc for gtk_file_chooser_set_do_overwrite_confirmation
http://developer.gnome.org/doc/API/2.0/gtk/GtkFileChooser.html#gtk-file-chooser-set-do-overwrite-confirmation
Regardless of this setting, the chooser will emit the "confirm-overwrite" signal when appropriate.

Correct version:
If set to TRUE, the chooser will emit the "confirm-overwrite" signal when appropriate.

Other information:
Comment 1 Matthias Clasen 2006-10-06 19:36:56 UTC
I think this is a bug in should_respond_after_confirm_overwrite()
Comment 2 Timothy Arceri 2013-05-20 03:48:58 UTC
Its been almost 7 years since this bug report and it seems the situation remains the same. 
Can someone please tell me what is the correct fix and I will provide a patch. 

To me it seems that the documentation should be updated since this is the way it has worked for all this time. Is there a reason why you would want to emit the "confirm-overwrite" signal regardless? Or is it that this regardless behaviour was a previous bug that was fixed but the documentation wasnt updated. 

For quick reference here is the code from should_respond_after_confirm_overwrite() showing that emit signal is only triggered when do_overwrite_confirmation is TRUE.

---------------------------------------------------------------------------------
should_respond_after_confirm_overwrite (GtkFileChooserDefault *impl,
					const gchar           *file_part,
					GFile                 *parent_file)
{
  GtkFileChooserDefaultPrivate *priv = impl->priv;
  GtkFileChooserConfirmation conf;

  if (!priv->do_overwrite_confirmation)
    return TRUE;

  conf = GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM;

  g_signal_emit_by_name (impl, "confirm-overwrite", &conf);
Comment 3 Timothy Arceri 2013-05-20 21:58:52 UTC
Created attachment 244875 [details] [review]
Update doco

This patch updates the documentation to reflect what is actually happening.
Comment 4 Timothy Arceri 2013-05-20 22:37:19 UTC
Created attachment 244876 [details] [review]
Update doco

minor rewording