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 605480 - No confirmation when overwriting files!
No confirmation when overwriting files!
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Downloads
2.29.x
Other Linux
: Normal major
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-26 13:36 UTC by Sam Morris
Modified: 2010-01-27 10:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for ephy-file-chooser.c (546 bytes, patch)
2010-01-05 14:29 UTC, Jorge Kalmbach
none Details | Review
Confirm overwrite and Replace sub_resources. (1.26 KB, patch)
2010-01-05 22:26 UTC, Jorge Kalmbach
needs-work Details | Review
Confirm overwrite and replace resources folder (1.26 KB, patch)
2010-01-13 14:06 UTC, Jorge Kalmbach
needs-work Details | Review
Proposed patch for bug 60579 & bug 60480 (2.54 KB, patch)
2010-01-20 14:58 UTC, Jorge Kalmbach
none Details | Review
proposed patch. (1.14 KB, patch)
2010-01-20 16:27 UTC, Jorge Kalmbach
none Details | Review
Proposed patch. (1.14 KB, patch)
2010-01-20 16:33 UTC, Jorge Kalmbach
accepted-commit_now Details | Review

Description Sam Morris 2009-12-26 13:36:53 UTC
In 2.29.3, when saving a page or image to disk, epiphany does not warn the user that the name they entered matches an already-existing file. Instead it overwrites the previously existing file without warning!
Comment 1 Wouter Bolsterlee (uws) 2010-01-02 17:22:56 UTC
Confirming. Without looking at the code I think the patch will be something like this:

  gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(c), TRUE);
Comment 2 Jorge Kalmbach 2010-01-05 14:29:06 UTC
Created attachment 150841 [details] [review]
Patch for ephy-file-chooser.c
Comment 3 Jorge Kalmbach 2010-01-05 22:26:58 UTC
Created attachment 150867 [details] [review]
Confirm overwrite and Replace sub_resources.

this patch adds confirmation for overwrite an existent file and save sub-resources the same way Firefox does.
Comment 4 Gustavo Noronha (kov) 2010-01-08 13:12:40 UTC
Review of attachment 150867 [details] [review]:

It's a good thing to have, but I think the patch needs work.

::: embed/ephy-web-view.c
@@ +3408,3 @@
+      g_object_unref (file);
+      return;
+    }

But if it exists, shouldn't we then clean up the contents before saving the new one? I haven't checked, but IIRC this comes after we have a go from the file chooser, so if we get an exists error here, it means we already have a 'yes' from the use to overwrite, right?

::: lib/ephy-file-chooser.c
@@ +371,3 @@
 
+  gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
+

indentation is quite off here
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2010-01-08 13:48:47 UTC
Note that this replace/overwrite should be atomical, it should happen when the download finishes only. Not before.
That's the logic we are following in downloads right now, see: bug #594192
Comment 6 Jorge Kalmbach 2010-01-13 14:05:06 UTC
>But if it exists, shouldn't we then clean up the contents before saving the new
>one?

On Firefox for instance, the existent resources folder is not cleaned up, instead, it does a merge with overwrite in the existent resources folder. With this patch, epiphany will have the same behavior.

> I haven't checked, but IIRC this comes after we have a go from the file
> chooser, so if we get an exists error here, it means we already have a 'yes'
> from the use to overwrite, right?

yes.
Comment 7 Jorge Kalmbach 2010-01-13 14:06:31 UTC
Created attachment 151339 [details] [review]
Confirm overwrite and replace resources folder
Comment 8 Jorge Kalmbach 2010-01-13 14:07:59 UTC
> indentation is quite off here
Fixed indentation on last patch submitted.
Comment 9 Gustavo Noronha (kov) 2010-01-19 23:35:42 UTC
Review of attachment 151339 [details] [review]:

Sorry for missing it the first time, one more cycle here. Do you have commit rights?

::: embed/ephy-web-view.c
@@ +3402,2 @@
   file = g_file_new_for_uri (destination_uri);
+

You added a space here, it seems.

::: lib/ephy-file-chooser.c
@@ +374,1 @@
  preview = gtk_image_new ();

I just noticed that you are adding this to ephy-file-chooser.c; I suck, I'm sorry. I don't think changing the behavior for all dialogs is what we want here. We should actually apply this fix locally - this means you need to call this on the dialog that is created in src/window-commands.c, in function window_cm_file_save_as.
Comment 10 Jorge Kalmbach 2010-01-20 14:58:51 UTC
Created attachment 151842 [details] [review]
Proposed patch for bug 60579 & bug 60480

Confirm overwrite + suggested filename.
Comment 11 Gustavo Noronha (kov) 2010-01-20 16:18:23 UTC
(In reply to comment #10)
> Created an attachment (id=151842) [details] [review]
> Proposed patch for bug 60579 & bug 60480
> 
> Confirm overwrite + suggested filename.

Please, don't =). One patch per issue!
Comment 12 Jorge Kalmbach 2010-01-20 16:27:18 UTC
Created attachment 151848 [details] [review]
proposed patch.
Comment 13 Jorge Kalmbach 2010-01-20 16:33:14 UTC
Created attachment 151850 [details] [review]
Proposed patch.
Comment 14 Gustavo Noronha (kov) 2010-01-21 01:03:28 UTC
Review of attachment 151850 [details] [review]:

Good, thanks!
Comment 15 Gustavo Noronha (kov) 2010-01-21 01:10:46 UTC
Pushed f007602b631fee9ac23c909abb75bd606f501a4f to master.
Comment 16 Reinout van Schouwen 2010-01-21 09:24:19 UTC
I can't dig up the bug right now but I remember requests for making GMail handle mailto: links. Is that implementable with this fix?
Comment 17 Gustavo Noronha (kov) 2010-01-26 22:41:46 UTC
(In reply to comment #16)
> I can't dig up the bug right now but I remember requests for making GMail
> handle mailto: links. Is that implementable with this fix?

I think you're confusing bugs? No, this bug does not help that cause, anyway =).
Comment 18 Reinout van Schouwen 2010-01-27 10:12:01 UTC
hm yes that comment should have gone somewhere else...