mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Remove use of nsSpecialSystemDirectory. r=dougt
This commit is contained in:
parent
97a6fcc778
commit
cb7218b7d7
@ -148,21 +148,24 @@ xptiInterfaceInfoManager::GetComponentsDir(nsILocalFile** aDir)
|
||||
{
|
||||
NS_ASSERTION(aDir,"loser!");
|
||||
|
||||
// Make a new one each time because 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;
|
||||
// We must make a new nsILocalFile each time because the caller *will*
|
||||
// modify it.
|
||||
|
||||
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
|
||||
xptiInterfaceInfoManager::BuildFileList(nsISupportsArray** aFileList)
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user