Closed
Bug 797349
Opened 12 years ago
Closed 12 years ago
Save originating URI in GIO for downloaded files
Categories
(Toolkit :: Downloads API, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: jhorak, Assigned: jhorak)
References
(Depends on 1 open bug)
Details
Attachments
(1 file, 3 obsolete files)
1.73 KB,
patch
|
jhorak
:
review+
MattN
:
checkin+
|
Details | Diff | Splinter Review |
From https://bugzilla.redhat.com/show_bug.cgi?id=862269 :
It would be nice if firefox could save the original uri for downloaded files.
This is pretty easy to do with GIO using gvfs metadata. I implemented this in
webkit:
https://bugs.webkit.org/show_bug.cgi?id=95188
Its a pretty trivial patch, so it should be easy to add to firefox too.
We want to use this to e.g. show the original location in the download directory in nautilus.
Comment 2•12 years ago
|
||
Comment on attachment 667478 [details] [diff] [review]
Save uri for downloaded files patch v1
Sadly there isn't enough context to show this but you have added your code in a path used only when the "add to recent documents" preference is enabled.
>+ (gpointer)source_uri.BeginReading(),
Use .get() when you want a null-terminated string. (Use BeginReading() when you have a const nsACString& and don't need it to be null-terminated.)
Attachment #667478 -
Flags: review?(neil) → review-
Assignee | ||
Comment 3•12 years ago
|
||
Posting fixed patch. Thanks for quick review.
Assignee: nobody → jhorak
Attachment #667478 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #667852 -
Flags: review?(neil)
Comment 4•12 years ago
|
||
+ gchar* uri = g_filename_to_uri(NS_ConvertUTF16toUTF8(path).get(),
+ NULL, NULL);
+ GFile* gio_file = g_file_new_for_uri(uri);
Why not use g_file_new_for_path() instead?
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Alexander Larsson from comment #4)
> + gchar* uri = g_filename_to_uri(NS_ConvertUTF16toUTF8(path).get(),
> + NULL, NULL);
> + GFile* gio_file = g_file_new_for_uri(uri);
>
> Why not use g_file_new_for_path() instead?
Okay, looks better, thanks.
Attachment #667852 -
Attachment is obsolete: true
Attachment #667852 -
Flags: review?(neil)
Attachment #667888 -
Flags: review?(neil)
Comment 6•12 years ago
|
||
(In reply to jhorak from comment #0)
> We want to use this to e.g. show the original location in the download
> directory in nautilus.
So, Nautilus doesn't do that yet? How can I verify that the patch works?
Assignee | ||
Comment 7•12 years ago
|
||
(In reply to neil@parkwaycc.co.uk from comment #6)
> (In reply to jhorak from comment #0)
> > We want to use this to e.g. show the original location in the download
> > directory in nautilus.
>
> So, Nautilus doesn't do that yet? How can I verify that the patch works?
From http://blogs.gnome.org/alexl/category/gio/
something like: gvfs-info -a "metadata::*" downloaded_file
Comment 8•12 years ago
|
||
Yeah, that should work.
Comment 9•12 years ago
|
||
Comment on attachment 667888 [details] [diff] [review]
Save uri for downloaded files patch v3
$ gvfs-info -a "metadata::*" ~/Downloads/comm-central_fedora-debug_test-xpcshell-bm18-tests1-linux-build259.txt.gz
attributes:
metadata::download-uri: http://ftp.mozilla.org/pub/mozilla.org/thunderbird/tinderbox-builds/comm-central-linux-debug/1349387487/comm-central_fedora-debug_test-xpcshell-bm18-tests1-linux-build259.txt.gz
metadata::nautilus-icon-position:
metadata::screen:
>+ // Storing source URI for later display in file manager by using GIO
Nit: possible slight improvement to comment grammar:
// Use GIO to store the source URI for later display in the file manager.
Attachment #667888 -
Flags: review?(neil) → review+
Assignee | ||
Comment 10•12 years ago
|
||
Fixed grammar, review+ from previous comment. Thanks.
Attachment #667888 -
Attachment is obsolete: true
Attachment #669050 -
Flags: review+
Attachment #669050 -
Flags: checkin?
Comment 11•12 years ago
|
||
Pushed to try server for testing: https://tbpl.mozilla.org/?tree=Try&rev=e57970061793
I'll push to inbound if all goes well.
Flags: in-testsuite-
Summary: Save originating uri for downloaded files → Save originating URI in GIO for downloaded files
Comment 12•12 years ago
|
||
Comment on attachment 669050 [details] [diff] [review]
Save uri for downloaded files patch v4
https://hg.mozilla.org/integration/mozilla-inbound/rev/0008531f1429
Thanks! In the future, please include the bug number and reviewer in the commit messages. See https://developer.mozilla.org/en-US/docs/Developer_Guide/Committing_Rules_and_Responsibilities#Commit_message_restrictions
Attachment #669050 -
Flags: checkin? → checkin+
Comment 13•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in
before you can comment on or make changes to this bug.
Description
•