Closed Bug 386279 Opened 18 years ago Closed 18 years ago

Download Actions dialog inaccurately duplicates logic in helper app service

Categories

(Firefox :: File Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: myk, Assigned: myk)

References

Details

The Download Actions dialog extracts information about helper apps from the mimeTypes.rdf file. This process duplicates logic in the helper app service (in FillContentHandlerProperties) that extracts such info into an nsIMIMEInfo object (soon to be an nsIHandlerInfo object). Not only is the code redundant, it isn't equivalent. For example, in the service the "useSystemDefault" property overrides the "saveToDisk" property, but in the dialog it's the other way around, so if both properties are set to true, the dialog claims Firefox will save such a file to disk when it will actually open it in the system default application. This may not be a problem because only one of those properties is ever true at a time (which makes me wonder why they're separate RDF properties; nsIMIMEInfo uses a single attribute, preferredAction, to distinguish between them), but it's suboptimal that the duplication creates the potential for such bugs, and there may be other such issues lurking in the code. And there's no need for it, since the dialog is capable of retrieving an nsIMIMEInfo object from the nsIMIMEService (and in fact does retrieve such an object in addition to extracting the same info by hand). The dialog should just use the information it gets from the nsIMIMEInfo object rather than querying the RDF datasource directly for it. I'll fix this in the process of fixing bug 377784, but I'm filing this bug to track the issue.
Sounds like a great plan. I think this is in fact the first step to getting rid of RDF entirely here: removing uses of it from the front end and making them go through interfaces.
Another case I found as I'm working through the code is that "open internally" is represented in the UI as "open with <some application>".
Now that we've switched to the new Applications prefpane, which doesn't touch the RDF directly, getting information from the handler service instead, this bug is fixed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.