Remove use of nsSpecialSystemDirectory. r=dougt

This commit is contained in:
jband%netscape.com 2000-04-25 05:01:05 +00:00
Родитель 97a6fcc778
Коммит cb7218b7d7
2 изменённых файлов: 21 добавлений и 14 удалений

Просмотреть файл

@ -148,20 +148,23 @@ xptiInterfaceInfoManager::GetComponentsDir(nsILocalFile** aDir)
{
NS_ASSERTION(aDir,"loser!");
// Make a new one each time because caller *will* modify it.
// We must make a new nsILocalFile each time because the caller *will*
// modify it.
nsCOMPtr<nsILocalFile> dir = do_CreateInstance(NS_LOCAL_FILE_PROGID);
if(!dir)
return PR_FALSE;
nsresult rv = dir->InitWithPath(
nsSpecialSystemDirectory(
nsSpecialSystemDirectory::XPCOM_CurrentProcessComponentDirectory));
if(NS_FAILED(rv))
return PR_FALSE;
NS_ADDREF(*aDir = dir);
return PR_TRUE;
nsCOMPtr<nsIProperties> dirService =
do_GetService(NS_DIRECTORY_SERVICE_PROGID);
if(dirService)
{
nsCOMPtr<nsILocalFile> dir;
dirService->Get("xpcom.currentProcess.componentDirectory",
NS_GET_IID(nsIFile), getter_AddRefs(dir));
if(dir)
{
NS_ADDREF(*aDir = dir);
return PR_TRUE;
}
}
return PR_FALSE;
}
PRBool

Просмотреть файл

@ -40,7 +40,10 @@
#include "nsIServiceManager.h"
#include "nsIFile.h"
#include "nsILocalFile.h"
#include "nsSpecialSystemDirectory.h"
#include "nsIDirectoryService.h"
#include "nsCRT.h"
#include "nsIAllocator.h"
#include "nsISupportsArray.h"
#include "nsInt64.h"
@ -52,6 +55,7 @@
#include "nsAutoLock.h"
#include "plhash.h"
#include "plstr.h"
#include "prprf.h"
#include "prio.h"