[10.4] Camino should set the kMDItemWhereFroms attribute on downloaded files

RESOLVED FIXED in Camino1.6

Status

Camino Graveyard
Downloading
--
enhancement
RESOLVED FIXED
12 years ago
10 years ago

People

(Reporter: Anders Conradi, Assigned: Mark Mentovai)

Tracking

({fixed1.8.1.12})

unspecified
Camino1.6
PowerPC
Mac OS X
fixed1.8.1.12

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051229 Camino/1.0b2
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051229 Camino/1.0b2

When Camino downloads a file to disk on Mac OSX Tiger it should set the kMDItemWhereFroms attribute on the file to the url the file was downloaded from in the same way as Safari does it.

Reproducible: Always

Steps to Reproduce:
1. Download a file
2. Reveal the file in the finder
3. Right click on the file and select Get Info
4. In the More Info part of the window there should be a field called Where From: containing the url the file was downloaded from. Now there isn't
See also bug 90918 comment 130.

Torben/Kreeger, this would have to be done in Core, right (as opposed to comments which we can sort-of do in Camino without Core support)?

Comment 2

12 years ago
We can add this before we drop 10.3 support, but adding the [10.4] tag to indicate this is a 10.4-only feature.

FWIW, this doesn't seem like it would necessarily require Core changes, but if we can get Core to do the Right Thing(tm), it's probably better.

cl
Summary: Camino should set the kMDItemWhereFroms attribute on downloaded files → [10.4] Camino should set the kMDItemWhereFroms attribute on downloaded files

Comment 3

12 years ago
Oh yeah. Confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 4

12 years ago
The main problem is that there is no Apple-supported way of doing this, ATM an app can only set metadata for file it owns (which won't be the case for most downloads).

As soon as such a method exists, it could be called either from Camino-code (but will not work for drag-and-drop saves) or from gecko (like bug 154580 and bug 90918).
Note that unlike Finder/"Spotlight" Comments (bug 154580 and
bug 90918), the kMDItemWhereFroms metadata is not preserved on certain types of copies.

This may be a good thing or a bad thing depending on your perspective (especially since the user has no way of modifying/removing them); Comments, OTOH, are preserved, but the user also has a way to remove them ;)
Assignee: mikepinkerton → nobody
OS: Mac OS X 10.2 → Mac OS X 10.4
QA Contact: downloading
*** Bug 357219 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 7

10 years ago
Proof-of-concept at bug 337051 attachment 292163 [details] [diff] [review]
Status: NEW → ASSIGNED
(Assignee)

Comment 8

10 years ago
Why does Bugzilla let you assign bugs to nobody?
Assignee: nobody → mark
Status: ASSIGNED → NEW
(In reply to comment #8)
> Why does Bugzilla let you assign bugs to nobody?

Because bmo is still using a version of Bugzilla without the fix for bug 92552?
(Assignee)

Comment 10

10 years ago
Created attachment 293133 [details] [diff] [review]
Use undocumented MDItemSetAttribute (trunk)
Attachment #293133 - Flags: review?(stuart.morgan)
(Assignee)

Comment 11

10 years ago
Created attachment 293134 [details] [diff] [review]
With extra symbol-lookup stuff for 10.3 compatibility (1.8 branch)
Attachment #293134 - Flags: review?(stuart.morgan)

Comment 12

10 years ago
Comment on attachment 293133 [details] [diff] [review]
Use undocumented MDItemSetAttribute (trunk)

>+  if (mReferrer) {
>+    if (NS_SUCCEEDED(mReferrer->GetSpec(url))) {

I can has && ?
Attachment #293133 - Flags: review?(stuart.morgan) → review+

Updated

10 years ago
Attachment #293134 - Flags: review?(stuart.morgan) → review+
(Assignee)

Comment 13

10 years ago
Comment on attachment 293133 [details] [diff] [review]
Use undocumented MDItemSetAttribute (trunk)

Stuart, you sure can.
Attachment #293133 - Flags: superreview?(mikepinkerton)
(Assignee)

Updated

10 years ago
Attachment #293134 - Flags: superreview?(mikepinkerton)
(Assignee)

Comment 14

10 years ago
I just crashed in SetMetadata in a really small download.  Looking...
(Assignee)

Comment 15

10 years ago
Created attachment 293225 [details] [diff] [review]
Use undocumented MDItemSetAttribute (trunk, v2)

The crash occurred when downloading something by option-click or a contextual menu's "Download Link Target…".  Those downloads come through SaveHeaderSniffer, and we had mTempFile null.  I hadn't counted on that, but you can certainly see how it might crash.

Incidentally, it affected the quarantine too, although the quarantine would fail silently when mTempFile was null.  That problem is addressed in this version.  So is Stuart's cat's request for &&.
Attachment #293133 - Attachment is obsolete: true
Attachment #293225 - Flags: superreview?(mikepinkerton)
Attachment #293133 - Flags: superreview?(mikepinkerton)
(Assignee)

Comment 16

10 years ago
Created attachment 293226 [details] [diff] [review]
With extra symbol-lookup stuff for 10.3 compatibility (1.8 branch, v2)
Attachment #293134 - Attachment is obsolete: true
Attachment #293226 - Flags: superreview?(mikepinkerton)
Attachment #293134 - Flags: superreview?(mikepinkerton)
Comment on attachment 293225 [details] [diff] [review]
Use undocumented MDItemSetAttribute (trunk, v2)

sr=pink
Attachment #293225 - Flags: superreview?(mikepinkerton) → superreview+
Comment on attachment 293226 [details] [diff] [review]
With extra symbol-lookup stuff for 10.3 compatibility (1.8 branch, v2)

sr=pink
Attachment #293226 - Flags: superreview?(mikepinkerton) → superreview+
(Assignee)

Comment 19

10 years ago
Checked in on the trunk and MOZILLA_1_8_BRANCH before 1.6b1.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Keywords: fixed1.8.1.12
Resolution: --- → FIXED
Target Milestone: --- → Camino1.6

Updated

10 years ago
Target Milestone: Camino1.6 → ---
Target Milestone: --- → Camino1.6
You need to log in before you can comment on or make changes to this bug.