Closed
Bug 454242
Opened 16 years ago
Closed 15 years ago
The location of files used by helper app locations is no longer consistent with the download location
Categories
(Core Graveyard :: File Handling, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.9.2a1
People
(Reporter: sdwilsh, Assigned: sdwilsh)
References
(Regressed 1 open bug)
Details
(Keywords: verified1.9.1, Whiteboard: [tb3needs])
Attachments
(2 files, 2 obsolete files)
6.03 KB,
patch
|
Details | Diff | Splinter Review | |
614 bytes,
patch
|
mconnor
:
review+
mconnor
:
superreview+
|
Details | Diff | Splinter Review |
We used to be good and dumped all files that were to be opened with helper applications in the same place as the download location. Then, the browser got fancy and allowed for more customizations of this, and exthandler is now out of date. This is really from bug 311292, but I've come to the realization that this is not what those folks actually want.
Attachment #337478 -
Flags: ui-review?(beltzner)
Attachment #337478 -
Flags: superreview?(cbiesinger)
Attachment #337478 -
Flags: review?(mconnor)
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][needs review mconnor][needs sr biesi][needs ui-r beltzner]
Target Milestone: --- → mozilla1.9.1b1
Updated•16 years ago
|
Attachment #337478 -
Flags: ui-review?(beltzner) → ui-review+
Comment 1•16 years ago
|
||
Comment on attachment 337478 [details] [diff] [review] v1.0 ui-yarrrr=beltzner
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][needs review mconnor][needs sr biesi][needs ui-r beltzner] → [has patch][needs review mconnor][needs sr biesi][has ui-r]
Comment 2•16 years ago
|
||
Comment on attachment 337478 [details] [diff] [review] v1.0 Why is the pref called folderList when it's just an integer identifying a single directory? +#define NS_PREF_BD_DIR "browser.download.dir" please put those defines near the top of the file (i.e. before any function definitions) I think using DOWNLOAD instead of BD would make it clearer what the defines stand for. +#define NS_FOLDER_VALUE_DESKTOP 0 can you make that an enum instead? +static inline +nsresult +GetDownloadDirectory(nsIFile **_directory) style of this file to have this all on a single line also, why the underscore prefix on the argument? + (void)prefs->GetIntPref(NS_PREF_BD_FOLDERLIST, &folderValue); I'm not a fan of the (void) casting. I'd prefer that you don't do it. (but at least you should be consistent within the file - the other two uses in here have a space after the cast) You aren't even consistently using the (void) where you are ignoring the return value... + nsCOMPtr<nsIProperties> dirService = + do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID); + if (!dirService) break; + + (void)dirService->Get(NS_OS_DESKTOP_DIR, + NS_GET_IID(nsILocalFile), + getter_AddRefs(dir)); Why not use NS_GetSpecialDirectory like in the other places in this function? + NS_ASSERTION(dir, "Somehow we didn't get a download directory!"); You shouldn't assert that here. NS_GetSpecialDirectory might have failed (non-OS X case). If you want to keep the assertion add an NS_ENSURE_SUCCESS for that.
Attachment #337478 -
Flags: superreview?(cbiesinger) → superreview+
Comment 3•16 years ago
|
||
also, this function seems too complex to be marked inline. just make it static nsresult GetDownloadDirectory.
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][needs review mconnor][needs sr biesi][has ui-r] → [needs new patch][needs review mconnor][has sr][has ui-r]
Comment 4•16 years ago
|
||
Comment on attachment 337478 [details] [diff] [review] v1.0 r=me with biesi's comments addressed
Attachment #337478 -
Flags: review?(mconnor) → review+
Assignee | ||
Comment 5•16 years ago
|
||
(In reply to comment #2) > (From update of attachment 337478 [details] [diff] [review]) > Why is the pref called folderList when it's just an integer identifying a > single directory? It was one of those bad decisions made long ago that we are stuck with :/ > also, why the underscore prefix on the argument? It's an outparam, which we sometimes use an underscore, and sometimes don't...
Assignee | ||
Updated•16 years ago
|
Flags: in-litmus?
Whiteboard: [needs new patch][needs review mconnor][has sr][has ui-r] → [needs new patch][has review][has sr][has ui-r]
Assignee | ||
Comment 6•16 years ago
|
||
Addresses review comments
Attachment #337478 -
Attachment is obsolete: true
Assignee | ||
Comment 7•16 years ago
|
||
It turns out that doing a qrefresh before generating a diff is a good idea...
Attachment #340585 -
Attachment is obsolete: true
Assignee | ||
Comment 8•16 years ago
|
||
Pushed to mozilla-central: http://hg.mozilla.org/mozilla-central/rev/7ca065e506eb
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs new patch][has review][has sr][has ui-r]
Comment 9•16 years ago
|
||
Wouldn't it make more sense to teach the standard file/directory provider about this stuff so that a simple get can be used both here and in the UI or something? Or does that not work for some reason?
Assignee | ||
Comment 10•16 years ago
|
||
It might - I'll admit to not even thinking about that approach.
What's the testcase for this? I have |browser.download.folderList| set to 2, and have /Users/stephend/Documents set as "Save files to". When I open a RealPlayer clip via its .RAM file on Mac OS X, I don't see it in either download manager or in my Documents folder.
Comment 12•16 years ago
|
||
Shawn, this bug has the in-limus flag set. So before I'm able to add this I have to make sure everything works. I've tested your patch with the latest trunk build and have problems with the custom download location. It's the same what Stephen already mentioned. * The custom location which should be "browser.download.dir" isn't used. It always uses the systems download location which is set on my location to ~/Library/Cache/TemporaryItems. * Further shouldn't we set NS_FOLDER_VALUE_DOWNLOADS as default on OS X 10.5? That will lower the frustration for a lot of users for those the temporary files are stored to desktop now.
Assignee | ||
Comment 13•16 years ago
|
||
(In reply to comment #11) > When I open a RealPlayer clip via its .RAM file on Mac OS X, I don't see it in > either download manager or in my Documents folder. That must mean that some plugin is handling it. If it doesn't show up in the download manager, we don't have any control over it. (In reply to comment #12) > Shawn, this bug has the in-limus flag set. So before I'm able to add this I > have to make sure everything works. I've tested your patch with the latest > trunk build and have problems with the custom download location. It's the same > what Stephen already mentioned. As in it doesn't even show up in the download manager? That's not the behavior I get. > * The custom location which should be "browser.download.dir" isn't used. It > always uses the systems download location which is set on my location to > ~/Library/Cache/TemporaryItems. I don't think that setting a string pref there is right. The code get's a complex preference, so you have to set it in the preferences UI. > * Further shouldn't we set NS_FOLDER_VALUE_DOWNLOADS as default on OS X 10.5? > That will lower the frustration for a lot of users for those the temporary > files are stored to desktop now. I had thought we did that globally for Firefox 3, but I can see clearly that it is not set that way. I'm fairly certain I reviewed a patch of jimm's that did this. We should probably file a new bug to get it set that way. What's really weird is that I swear this was working when I landed it, as I did a bazillion local tests to make sure everything was working as expected :(
Comment 14•16 years ago
|
||
(In reply to comment #13) > > When I open a RealPlayer clip via its .RAM file on Mac OS X, I don't see it in > > either download manager or in my Documents folder. > That must mean that some plugin is handling it. If it doesn't show up in the > download manager, we don't have any control over it. I think, that Steven has moved his download folder too (changed the location within Safari?). > > * The custom location which should be "browser.download.dir" isn't used. It > > always uses the systems download location which is set on my location to > > ~/Library/Cache/TemporaryItems. > I don't think that setting a string pref there is right. The code get's a > complex preference, so you have to set it in the preferences UI. I've updated the path via preferences | download folder. So the correct value should have been set. But in any way it downloads the file to the above given directory, which is the system wide download folder (set via Safari). > > * Further shouldn't we set NS_FOLDER_VALUE_DOWNLOADS as default on OS X 10.5? > > What's really weird is that I swear this was working when I landed it, as I did > a bazillion local tests to make sure everything was working as expected :( I'll file that bug and make it depends on that one.
Assignee | ||
Comment 15•16 years ago
|
||
So it seems like this isn't fixed. Can you do me a favor and give me exact steps on how you are doing this download so I can make sure I test exactly that please?
Status: RESOLVED → REOPENED
Flags: blocking1.9.1?
Resolution: FIXED → ---
Comment 16•16 years ago
|
||
(In reply to comment #15) > So it seems like this isn't fixed. Can you do me a favor and give me exact > steps on how you are doing this download so I can make sure I test exactly that > please? I've already started to file a new bug for that part. But ok, let's do it here. It's mostly simple to reproduce: 1. Create a fresh profile 2. Open about:config and set "browser.download.folderList" to '1' 3. Goto http://www.google.com/search?q=pdf and click any pdf 4. Check your system download folder the file is stored correctly 5. Goto preferences and select another download folder 6. Check "browser.download.folderList" set it is set to '2' now 7. Do step 3 again With step 7 you will see that the systems download folder is used again, instead of the formerly selected user defined download folder.
Comment 17•16 years ago
|
||
(In reply to comment #16) > (In reply to comment #15) > > So it seems like this isn't fixed. Can you do me a favor and give me exact > > steps on how you are doing this download so I can make sure I test exactly that > > please? > > I've already started to file a new bug for that part. But ok, let's do it here. > It's mostly simple to reproduce: > > 1. Create a fresh profile > 2. Open about:config and set "browser.download.folderList" to '1' > 3. Goto http://www.google.com/search?q=pdf and click any pdf > 4. Check your system download folder the file is stored correctly > 5. Goto preferences and select another download folder > 6. Check "browser.download.folderList" set it is set to '2' now > 7. Do step 3 again > > With step 7 you will see that the systems download folder is used again, > instead of the formerly selected user defined download folder. Isn't content that's displayed within the content window via a plugin going to end up in the cache? Maybe pdf is a bad example, can you reproduce this for other file types like zips? I checked on windows and for other files like zips, this isn't reproducible. For pdfs, the file is in the cache folder and is not displayed in the downloads window. That seems correct to me.
Comment 18•16 years ago
|
||
> Isn't content that's displayed within the content window via a plugin going to
> end up in the cache?
Jim, on Mac there is no PDF plug-in installed by default, and PDFs are handled in an external app (typically Preview).
Comment 19•16 years ago
|
||
Jim, this bug is for OS X only where the file handling is a bit different then on Windows. At least what the majority of users say. ;)
Comment 20•16 years ago
|
||
adding status whiteboard indicating that this affects TB3 as well.
Whiteboard: [tb3needs]
Comment 21•16 years ago
|
||
sdwilsh: we would seem to have missed the 1.9.1beta1 target milestone, can you reset that field to something appropriate?
Assignee | ||
Comment 22•16 years ago
|
||
I'll talk to drivers about this tomorrow to get it blocking (P2)
Priority: -- → P2
Target Milestone: mozilla1.9.1b1 → mozilla1.9.2a1
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Updated•15 years ago
|
Assignee | ||
Comment 23•15 years ago
|
||
So it's pretty clear that I didn't test this code path, but the fix is utterly trivial. I just wish there was a way to make an automated test case for this :(
Attachment #359077 -
Flags: superreview?(mconnor)
Attachment #359077 -
Flags: review?(mconnor)
Assignee | ||
Updated•15 years ago
|
Whiteboard: [tb3needs] → [needs review mconnor][needs sr mconnor][tb3needs]
Comment 24•15 years ago
|
||
Comment on attachment 359077 [details] [diff] [review] follow-up v1.0 Yeah, oy. I hate that these are so similar, and yet so different.
Attachment #359077 -
Flags: superreview?(mconnor)
Attachment #359077 -
Flags: superreview+
Attachment #359077 -
Flags: review?(mconnor)
Attachment #359077 -
Flags: review+
Assignee | ||
Updated•15 years ago
|
Status: REOPENED → ASSIGNED
Whiteboard: [needs review mconnor][needs sr mconnor][tb3needs] → [can land][tb3needs]
Assignee | ||
Comment 25•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/8caadf42408c
Status: ASSIGNED → RESOLVED
Closed: 16 years ago → 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 26•15 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/d805ea008384
Keywords: fixed1.9.1
Assignee | ||
Updated•15 years ago
|
Whiteboard: [can land][tb3needs] → [tb3needs]
Comment 27•15 years ago
|
||
verified fixed on the 1.9.1 branch using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090128 Shiretoko/3.1b3pre following the steps in Comment 16.
Keywords: fixed1.9.1 → verified1.9.1
Comment 28•15 years ago
|
||
I find this new behavior worse than the previous (also bad) behavior. Anything opened by a helper app is (for me) disposable. Before this patch landed, I knew that anything left on my desktop could be thrown away. Now, all of my temporarily opened PDFs are mixed in with the items I wanted to download and keep in my Downloads folder.
Assignee | ||
Comment 29•15 years ago
|
||
(In reply to comment #28) > I find this new behavior worse than the previous (also bad) behavior. Anything > opened by a helper app is (for me) disposable. Before this patch landed, I > knew that anything left on my desktop could be thrown away. Now, all of my > temporarily opened PDFs are mixed in with the items I wanted to download and > keep in my Downloads folder. You are looking for bug 311292.
Comment 30•15 years ago
|
||
Shawn, thanks! That looks great. Verified too with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090129 Minefield/3.2a1pre
Status: RESOLVED → VERIFIED
Comment 31•15 years ago
|
||
Shawn, wouldn't it be possible to have an automated test here instead of a manually run litmus test? This bug has a higher priority and it would be important to catch a regression as soon as possible.
Flags: in-testsuite?
Assignee | ||
Comment 33•15 years ago
|
||
(In reply to comment #31) > Shawn, wouldn't it be possible to have an automated test here instead of a > manually run litmus test? This bug has a higher priority and it would be > important to catch a regression as soon as possible. It's not possible since we'd have to run another application to verify it.
Flags: in-testsuite? → in-testsuite-
This isn't fixed for me on 10.4, with a new profile, using the STR in comment 16. Build identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.1b3pre) Gecko/20090130 Shiretoko/3.1b3pre Temp files from RealPlayer/Preview (PDFs) are still being thrown to the Desktop, rather than being stored in the "Downloads" folder, which is the default now on new profiles.
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 35•15 years ago
|
||
Stephen - I'm betting you are seeing bug 476174, especially since it's on 10.4. I'm assuming custom locations work correctly now?
Well, I changed Safari's download location to a custom folder, then created a new profile, and set Shiretoko to its own custom-download directory, rather than the "Downloads" folder. I tried it first with browser.download.folderList set to 1, and I got temporary files saved to the desktop; then I tried browser.download.folderList set to 2, and the "Saves files to" textfield just goes blank, but temp files still go to the desktop.
Assignee | ||
Comment 37•15 years ago
|
||
(In reply to comment #36) > Well, I changed Safari's download location to a custom folder, then created a > new profile, and set Shiretoko to its own custom-download directory, rather > than the "Downloads" folder. Which version of Safari? Newer versions don't update the preference that we check. You can use Camino to set the pref though. > I tried it first with browser.download.folderList set to 1, and I got temporary > files saved to the desktop; then I tried browser.download.folderList set to 2, > and the "Saves files to" textfield just goes blank, but temp files still go to > the desktop. If you set it to two and didn't set a path in the UI, it's going to revert to the system download location, which I'd suspect is going to be the Desktop.
The tryserver build over in bug 476174 has fixed the issue I was seeing; reclosing this bug, thanks!
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Updated•15 years ago
|
Status: RESOLVED → VERIFIED
Comment 39•15 years ago
|
||
I think this change was a step in the wrong direction. See bug 369462 comment 5.
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•