Closed Bug 473078 Opened 11 years ago Closed 11 years ago

modernize xpcom i/o launch and reveal methods on Mac OS X

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: jaas)

Details

Attachments

(1 file)

Attached patch fix v1.0Splinter Review
We should modernize our xpcom i/o launch and reveal methods on Mac OS X. This is part of bug 456662.
Attachment #356430 - Flags: superreview?(doug.turner)
Comment on attachment 356430 [details] [diff] [review]
fix v1.0

Looks like NSWorkspace makes us use alot less code!.  Unfortunely, i have never used this class and the docs aren't that great.

Just a few comments:

do you really need to do this?

-  PRInt32 aliasSize = GetAliasSizeFromRecord(aliasHeader);
+  PRInt32 aliasSize = ::GetAliasSizeFromPtr(&aliasHeader);

Does this:
+    success = [[NSWorkspace sharedWorkspace] selectFile:[(NSURL*)urlRef path] inFileViewerRootedAtPath:@""];

actually open up a new Finder window that contains urlRef?

what about this:

+    success = [[NSWorkspace sharedWorkspace] openURL:(NSURL*)urlRef];

if urlRef is a .html file, what is launched?  Will we open up safari or something?
The GetAliasSizeFromRecord stuff is just cleanup along for the ride. We don't need to abstract that function call with a macro any more because we don't support 10.3 any more.

"selectFile:inFileViewerRootedAtPath:" does open a new Finder window containing whatever we give as a path for selectFile:. It uses the main viewer if there is one otherwise opens a new one.

"openURL:" will open the URL basically as if the user double clicked on it in the Finder - it'll open in accordance with the user's OS preferences. So if you call that on an HTML document then the HTML document will (probably) open in the user's default web browser.
Attachment #356430 - Flags: superreview?(doug.turner) → superreview+
Comment on attachment 356430 [details] [diff] [review]
fix v1.0

okay.
pushed to mozilla-central

http://hg.mozilla.org/mozilla-central/rev/0c62506aefd6
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.