Closed Bug 102013 Opened 23 years ago Closed 3 years ago

nsIFilePicker (widget) returns a nsIURI (necko)

Categories

(Core :: XUL, defect)

defect
Not set
minor

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: alecf, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: embed, topembed-)

We have a wierd dependency between widget and necko: if you are a consumer of
nsIFilePicker, you have to pull in necko because nsIFilePicker returns an nsIURI.

I have two ideas, looking for input:
- change nsIFilePicker to return an nsIFile or nsILocalFile
- move nsIFilePicker into xpfe somewhere.

I prefer the first option (use nsIFile)
Blocks: 100107
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.6
yea, option #1 seems to make sense, though, even after doing that, I think we're
still bound to necko (bugzilla 100212 should be a blocker for this bug if we go
w/ option #1?).
Priority: -- → P2
Target Milestone: mozilla0.9.6 → mozilla0.9.7
I'd really love to fix this, but it's just not high on the list!
Target Milestone: mozilla0.9.7 → mozilla0.9.8
pushing out non-critical bugs past moz 1.0
Target Milestone: mozilla0.9.8 → mozilla1.1
Keywords: topembed
topembed-
- by triage team (cofmann, cathleen, marcia)
Keywords: topembedembed, topembed-
Priority: P2 → P3
woah, 1.1 came up quick. Throwing these bugs over to 1.2.. little or no work has
been done and there is no way that these bugs can be fixed in 1.1.
Target Milestone: mozilla1.1alpha → mozilla1.2alpha
ugh, this is going to be a pain to fix (its all JS stuff) and with no real gain
for now. Moving out
Blocks: 106686
No longer blocks: 100107
Target Milestone: mozilla1.2alpha → Future
for the js consumers:

var ioService = Components.classes["@mozilla.org/network/io-service;1"]
ioService = ioService.getService(Components.interfaces.nsIIOService);

var fileURL = ioService.newFileURI(fp.file).QueryInterface
(Components.interfaces.

I'm using this for http://bugzilla.mozilla.org/show_bug.cgi?id=121122

how many js consumers are there?
most JS consumers want the URL string, so really they should be using
ioService.getURLSpecFromFile()

However, after bug 166792 is fixed, this will be available from the
nsIFileProtocolHandler

for example, here's the first patch from attachment 97922 [details] [diff] [review]

+      var fileHandler = XPCU.QI(ioService.getProtocolHandler("file"),
"nsIFileProtocolHandler");
+
+      var url = fileHandler.getURLSpecFromFile(file);
 
-      var url = ioService.getURLSpecFromFile(file);

(slightly different in that it gets the url string, but that is often what JS
consumers want)
ok, I'll do it your way in the file picker / compose bug.

thanks for the info.
Severity: normal → minor
Status: ASSIGNED → NEW
Depends on: 167282
OS: Windows 2000 → All
Priority: P3 → --
Hardware: x86 → All
Target Milestone: Future → ---
Assignee: alecf → nobody
QA Contact: jrgmorrison → xptoolkit.widgets

Resolving WORKSFORME in the sense that it's all just libxul now.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.