From c3a3ebc592aacd3bf10e943095363e19ddac11ee Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Tue, 11 Jan 2000 01:19:06 +0000 Subject: [PATCH] Fixing Xpcom INIT to use the new NS_NewLocalFile. may not work on mac yet. git-svn-id: svn://10.0.0.236/branches/NSIFILE_01062000_BRANCH@57321 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpinstall/stub/xpistub.cpp | 34 ++++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/mozilla/xpinstall/stub/xpistub.cpp b/mozilla/xpinstall/stub/xpistub.cpp index 729b5e24cd8..544c940fb6e 100644 --- a/mozilla/xpinstall/stub/xpistub.cpp +++ b/mozilla/xpinstall/stub/xpistub.cpp @@ -90,23 +90,25 @@ PR_PUBLIC_API(nsresult) XPI_Init( // Initialize XPCOM and AutoRegister() its components //-------------------------------------------------------------------- #ifdef XP_MAC - OSErr err = noErr; - long xpiStubDirID = 0; - Boolean isDir = false; - - FSpGetDirectoryID(&aXPIStubDir, &xpiStubDirID, &isDir); - nsfsDirectory = aXPIStubDir; - rv = NS_InitXPCOM(&gServiceMgr, &nsfsDirectory); // mac stuff FIX dougt/sdagley FIX + nsCOMPtr file; + rv = NS_NewLocalFile(getter_AddRefs(file)); + if (NS_SUCCEEDED(rv) && file) + { + nsCOMPtr macFile = do_QueryInterface(file); + if (macFile) + macFile->InitWithFSSpec(aXPIStubDir); + } + rv = NS_InitXPCOM(&gServiceMgr, file); #elif defined(XP_PC) || defined(XP_UNIX) - //nsfsDirectory = componentPath; - - // nsCOMPtr file; - // rv = NS_NewLocalFile(getter_AddRefs(file)); - // if (NS_SUCCEEDED(rv) && file) - // { - // file->InitWithPath(aProgramDir) - - rv = NS_InitXPCOM(&gServiceMgr, NULL); //file); // fix!!! + + nsCOMPtr file; + rv = NS_NewLocalFile(getter_AddRefs(file)); + if (NS_SUCCEEDED(rv) && file) + { + file->InitWithPath(aProgramDir) + } + rv = NS_InitXPCOM(&gServiceMgr, file); + #else rv = NS_InitXPCOM(&gServiceMgr, NULL); #endif