From 32e8dc3056c00ccfaca7c55fad5c8bc4cb747ea5 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Wed, 22 Aug 2001 04:33:17 +0000 Subject: [PATCH] #95651 r=mkaply, timeless a=blizzard OS/2 only - code from Javier Pedemonte - fix Launch/Reveal behavior for Os/2 git-svn-id: svn://10.0.0.236/trunk@101624 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/io/nsLocalFileOS2.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/mozilla/xpcom/io/nsLocalFileOS2.cpp b/mozilla/xpcom/io/nsLocalFileOS2.cpp index cee1e7d5605..a16367ab97e 100644 --- a/mozilla/xpcom/io/nsLocalFileOS2.cpp +++ b/mozilla/xpcom/io/nsLocalFileOS2.cpp @@ -2245,11 +2245,23 @@ nsLocalFile::SetPersistentDescriptor(const char * aPersistentDescriptor) NS_IMETHODIMP nsLocalFile::Reveal() { - nsXPIDLCString platformPath; + PRBool isDirectory = PR_FALSE; + nsXPIDLCString path; - GetPath(getter_Copies(platformPath)); + IsDirectory(&isDirectory); + if (isDirectory) + { + GetPath(getter_Copies(path)); + } + else + { + nsCOMPtr parent; + GetParent(getter_AddRefs(parent)); + if (parent) + parent->GetPath(getter_Copies(path)); + } - HOBJECT hobject = WinQueryObject(platformPath); + HOBJECT hobject = WinQueryObject(path); WinOpenObject( hobject, OPEN_DEFAULT, TRUE); // we don't care if it succeeded or failed. @@ -2260,7 +2272,15 @@ nsLocalFile::Reveal() NS_IMETHODIMP nsLocalFile::Launch() { - return NS_ERROR_FAILURE; + nsXPIDLCString platformPath; + + GetPath(getter_Copies(platformPath)); + + HOBJECT hobject = WinQueryObject(platformPath); + WinOpenObject( hobject, OPEN_DEFAULT, TRUE); + + // we don't care if it succeeded or failed. + return NS_OK; } nsresult