NOT PART OF BUILD. Created variant of NS_InitEmbedding that accepts an nsILocalFile object as a parameter

git-svn-id: svn://10.0.0.236/trunk@72764 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
locka%iol.ie
2000-06-21 13:19:12 +00:00
parent 7998f606b0
commit a0d9972be0
2 changed files with 23 additions and 11 deletions

View File

@@ -23,7 +23,6 @@
*/
#include "nsIServiceManager.h"
#include "nsILocalFile.h"
#include "nsIEventQueueService.h"
#include "nsIStringBundle.h"
@@ -68,7 +67,24 @@ extern "C" void NS_SetupRegistry();
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
nsresult NS_InitEmbedding(const char *aPath)
{
// Create an object to represent the path
nsILocalFile *localFile = nsnull;
if (aPath && strlen(aPath) > 0)
{
NS_NewLocalFile(aPath, &localFile);
}
nsresult rv = NS_InitEmbedding(localFile);
NS_IF_RELEASE(localFile);
return rv;
}
nsresult NS_InitEmbedding(nsILocalFile *aPath)
{
// Reentrant calls to this method do nothing except increment a counter
if (++sInitCounter > 1)
@@ -82,18 +98,10 @@ nsresult NS_InitEmbedding(const char *aPath)
if (!sXPCOMInitializedFlag)
#endif
{
// Create an object to represent the path
nsILocalFile *pBinDirPath = nsnull;
if (aPath && strlen(aPath) > 0)
{
NS_NewLocalFile(aPath, &pBinDirPath);
}
// Initialise XPCOM
if (pBinDirPath)
if (aPath)
{
NS_InitXPCOM(&sServiceManager, pBinDirPath);
NS_RELEASE(pBinDirPath);
NS_InitXPCOM(&sServiceManager, aPath);
}
else
{
@@ -155,6 +163,7 @@ nsresult NS_InitEmbedding(const char *aPath)
return NS_OK;
}
nsresult NS_TermEmbedding()
{
// Reentrant calls to this method do nothing except decrement a counter

View File

@@ -25,7 +25,10 @@
#ifndef NSEMBEDAPI_H
#define NSEMBEDAPI_H
#include "nsILocalFile.h"
extern nsresult NS_InitEmbedding(const char *aPath);
extern nsresult NS_InitEmbedding(nsILocalFile *aPath);
extern nsresult NS_TermEmbedding();
#endif