Changed from using strings for nsIDirectoryService props to using macro names defined in nsDirectoryServiceDefs.h

This commit is contained in:
conrad%ingress.com 2000-08-11 20:31:57 +00:00
parent 651f462b43
commit d9e8edcf29
17 changed files with 79 additions and 56 deletions

View File

@ -36,6 +36,7 @@
/* Implements nsXPCToolsCompiler. */
#include "xpctools_private.h"
#include "nsDirectoryServiceDefs.h"
NS_IMPL_ISUPPORTS1(nsXPCToolsCompiler, nsIXPCToolsCompiler)
@ -54,7 +55,7 @@ NS_IMETHODIMP nsXPCToolsCompiler::GetBinDir(nsILocalFile * *aBinDir)
*aBinDir = nsnull;
nsCOMPtr<nsIFile> file;
nsresult rv = NS_GetSpecialDirectory("xpcom.currentProcessDirectory", getter_AddRefs(file));
nsresult rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR, getter_AddRefs(file));
if(NS_FAILED(rv))
return rv;

View File

@ -32,6 +32,7 @@
#include "nsScriptSecurityManager.h"
#include "nsIAggregatePrincipal.h"
#include "nsXPIDLString.h"
#include "nsDirectoryServiceDefs.h"
#ifdef NS_USE_CACHE_MANAGER_FOR_JAR
#include "nsINetDataCacheManager.h"
@ -539,7 +540,7 @@ nsJARChannel::GetCacheFile(nsIFile* *cacheFile)
nsresult rv;
nsCOMPtr<nsIFile> jarCacheFile;
rv = NS_GetSpecialDirectory("xpcom.currentProcess.componentDirectory",
rv = NS_GetSpecialDirectory(NS_XPCOM_COMPONENT_DIR,
getter_AddRefs(jarCacheFile));
if (NS_FAILED(rv)) return rv;

View File

@ -23,6 +23,7 @@
#include "nsIRegistry.h"
#include "nsIEnumerator.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "NSReg.h"
#include "prmem.h"
#include "prlock.h"
@ -444,7 +445,7 @@ NS_IMETHODIMP nsRegistry::OpenWellKnownRegistry( nsWellKnownRegistry regid ) {
NS_GET_IID(nsIProperties),
getter_AddRefs(directoryService));
if (NS_FAILED(rv)) return rv;
directoryService->Get("xpcom.currentProcess.componentRegistry", NS_GET_IID(nsIFile),
directoryService->Get(NS_XPCOM_COMPONENT_REGISTRY_FILE, NS_GET_IID(nsIFile),
getter_AddRefs(registryLocation));
if (registryLocation)

View File

@ -30,6 +30,7 @@
#include "nsCOMPtr.h"
#include "nsIFileStreams.h"
#include "nsNetUtil.h"
#include "nsDirectoryServiceDefs.h"
#ifdef XP_MAC
extern "C" void GC_gcollect(void);
@ -97,7 +98,7 @@ nsAboutBloat::NewChannel(nsIURI *aURI, nsIChannel **result)
}
else {
nsCOMPtr<nsIFile> file;
rv = NS_GetSpecialDirectory("xpcom.currentProcess.componentDirectory",
rv = NS_GetSpecialDirectory(NS_XPCOM_COMPONENT_DIR,
getter_AddRefs(file));
if (NS_FAILED(rv)) return rv;

View File

@ -32,6 +32,7 @@
#include "nsScriptSecurityManager.h"
#include "nsIAggregatePrincipal.h"
#include "nsXPIDLString.h"
#include "nsDirectoryServiceDefs.h"
#ifdef NS_USE_CACHE_MANAGER_FOR_JAR
#include "nsINetDataCacheManager.h"
@ -539,7 +540,7 @@ nsJARChannel::GetCacheFile(nsIFile* *cacheFile)
nsresult rv;
nsCOMPtr<nsIFile> jarCacheFile;
rv = NS_GetSpecialDirectory("xpcom.currentProcess.componentDirectory",
rv = NS_GetSpecialDirectory(NS_XPCOM_COMPONENT_DIR,
getter_AddRefs(jarCacheFile));
if (NS_FAILED(rv)) return rv;

View File

@ -45,6 +45,7 @@
#include "prprf.h"
#include "nsXPIDLString.h"
#include "nsIFile.h"
#include "nsDirectoryServiceDefs.h"
static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
@ -91,36 +92,36 @@ nsResProtocolHandler::Init()
return NS_ERROR_OUT_OF_MEMORY;
// set up initial mappings
rv = SetSpecialDir("ProgramDir", "system.OS_CurrentProcessDirectory");
rv = SetSpecialDir("ProgramDir", NS_OS_CURRENT_PROCESS_DIR);
if (NS_FAILED(rv)) return rv;
// make "res:///" == "resource:/"
rv = SetSpecialDir("", "xpcom.currentProcess");
rv = SetSpecialDir("", NS_XPCOM_CURRENT_PROCESS_DIR);
if (NS_FAILED(rv)) return rv;
rv = SetSpecialDir("CurrentDir", "system.OS_CurrentWorkingDirectory");
rv = SetSpecialDir("CurrentDir", NS_OS_CURRENT_WORKING_DIR);
if (NS_FAILED(rv)) return rv;
rv = SetSpecialDir("CurrentDrive", "system.OS_DriveDirectory");
rv = SetSpecialDir("CurrentDrive", NS_OS_DRIVE_DIR);
if (NS_FAILED(rv)) return rv;
rv = SetSpecialDir("TempDir", "system.OS_TemporaryDirectory");
rv = SetSpecialDir("TempDir", NS_OS_TEMP_DIR);
if (NS_FAILED(rv)) return rv;
rv = SetSpecialDir("ComponentsDir", "xpcom.currentProcess.componentDirectory");
rv = SetSpecialDir("ComponentsDir", NS_XPCOM_COMPONENT_DIR);
if (NS_FAILED(rv)) return rv;
rv = SetSpecialDir("SystemDir",
#ifdef XP_MAC
"system.SystemDirectory"
NS_OS_SYSTEM_DIR
#elif XP_OS2
"system.SystemDirectory"
NS_OS_SYSTEM_DIR
#elif XP_PC
"system.SystemDirectory"
NS_OS_SYSTEM_DIR
#elif XP_BEOS
"system.SystemDirectory"
NS_OS_SYSTEM_DIR
#else
"system.LibDirectory" // XXX ???
NS_UNIX_LIB_DIR // XXX ???
#endif
);
if (NS_FAILED(rv)) return rv;
@ -128,7 +129,7 @@ nsResProtocolHandler::Init()
// Set up the "Resource" root to point to the old resource location
// such that:
// resource://<path> == res://Resource/<path>
rv = SetSpecialDir("Resource", "xpcom.currentProcess");
rv = SetSpecialDir("Resource", NS_XPCOM_CURRENT_PROCESS_DIR);
if (NS_FAILED(rv)) return rv;
return rv;

View File

@ -40,6 +40,7 @@
#include "nsFileLocations.h"
#include "nsHelperAppRDF.h"
#include "nsIMIMEInfo.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIHelperAppLauncherDialog.h"
#include "nsIFilePicker.h"
@ -410,10 +411,10 @@ nsresult nsExternalAppHandler::SetUpTempFile(nsIChannel * aChannel)
#ifdef XP_MAC
// create a temp file for the data...and open it for writing.
NS_GetSpecialDirectory("system.DesktopDirectory", getter_AddRefs(mTempFile));
NS_GetSpecialDirectory(NS_MAC_DESKTOP_DIR, getter_AddRefs(mTempFile));
#else
// create a temp file for the data...and open it for writing.
NS_GetSpecialDirectory("system.OS_TemporaryDirectory", getter_AddRefs(mTempFile));
NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(mTempFile));
#endif
nsCOMPtr<nsIURI> uri;

View File

@ -63,6 +63,7 @@
#include "nsILocalFile.h"
#include "nsLocalFile.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsICategoryManager.h"
#include "nsAtomService.h"
@ -241,7 +242,7 @@ nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result,
rv = binDirectory->IsDirectory(&value);
if (NS_SUCCEEDED(rv) && value)
gDirectoryService->Define("xpcom.currentProcessDirectory", binDirectory);
gDirectoryService->Define(NS_XPCOM_INIT_CURRENT_PROCESS_DIR, binDirectory);
//Since people are still using the nsSpecialSystemDirectory, we should init it.
char* path;

View File

@ -58,6 +58,7 @@
#include "nsILocalFile.h"
#include "nsLocalFile.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "plstr.h"
#include "prlink.h"
@ -493,7 +494,7 @@ nsComponentManagerImpl::PlatformInit(void)
NS_GET_IID(nsIProperties),
getter_AddRefs(directoryService));
directoryService->Get("xpcom.currentProcess.componentDirectory", NS_GET_IID(nsIFile), getter_AddRefs(mComponentsDir));
directoryService->Get(NS_XPCOM_COMPONENT_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mComponentsDir));
if (!mComponentsDir)
return NS_ERROR_OUT_OF_MEMORY;
@ -1998,8 +1999,8 @@ nsComponentManagerImpl::AutoRegister(PRInt32 when, nsIFile *inDirSpec)
if (NS_FAILED(rv)) return rv;
// Don't care if undefining fails
directoryService->Undefine("xpcom.currentProcess.componentDirectory");
rv = directoryService->Define("xpcom.currentProcess.componentDirectory", dir);
directoryService->Undefine(NS_XPCOM_COMPONENT_DIR);
rv = directoryService->Define(NS_XPCOM_COMPONENT_DIR, dir);
if (NS_FAILED(rv)) return rv;
}
else
@ -2008,7 +2009,7 @@ nsComponentManagerImpl::AutoRegister(PRInt32 when, nsIFile *inDirSpec)
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (NS_FAILED(rv)) return rv;
rv = directoryService->Get("xpcom.currentProcess.componentDirectory", NS_GET_IID(nsIFile), getter_AddRefs(dir));
rv = directoryService->Get(NS_XPCOM_COMPONENT_DIR, NS_GET_IID(nsIFile), getter_AddRefs(dir));
if (NS_FAILED(rv)) return rv; // XXX translate error code?
}

View File

@ -23,6 +23,7 @@
#include "nsIRegistry.h"
#include "nsIEnumerator.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "NSReg.h"
#include "prmem.h"
#include "prlock.h"
@ -444,7 +445,7 @@ NS_IMETHODIMP nsRegistry::OpenWellKnownRegistry( nsWellKnownRegistry regid ) {
NS_GET_IID(nsIProperties),
getter_AddRefs(directoryService));
if (NS_FAILED(rv)) return rv;
directoryService->Get("xpcom.currentProcess.componentRegistry", NS_GET_IID(nsIFile),
directoryService->Get(NS_XPCOM_COMPONENT_REGISTRY_FILE, NS_GET_IID(nsIFile),
getter_AddRefs(registryLocation));
if (registryLocation)

View File

@ -23,6 +23,7 @@
/* Implementation of xptiInterfaceInfoManager. */
#include "xptiprivate.h"
#include "nsDirectoryServiceDefs.h"
NS_IMPL_THREADSAFE_ISUPPORTS1(xptiInterfaceInfoManager, nsIInterfaceInfoManager)
@ -158,7 +159,7 @@ xptiInterfaceInfoManager::GetComponentsDir(nsILocalFile** aDir)
if(dirService)
{
nsCOMPtr<nsILocalFile> dir;
dirService->Get("xpcom.currentProcess.componentDirectory",
dirService->Get(NS_XPCOM_COMPONENT_DIR,
NS_GET_IID(nsIFile), getter_AddRefs(dir));
if(dir)
{

View File

@ -38,6 +38,7 @@
#include "nsFileStream.h"
#include "nsSpecialSystemDirectory.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIPref.h"
@ -2436,7 +2437,7 @@ nsInstall::ExtractFileFromJar(const nsString& aJarfile, nsIFile* aSuggestedName,
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
directoryService->Get("system.OS_TemporaryDirectory", NS_GET_IID(nsIFile), getter_AddRefs(tempFile));
directoryService->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), getter_AddRefs(tempFile));
nsString tempFileName; tempFileName.AssignWithConversion("xpinstall");

View File

@ -38,6 +38,8 @@
#include "nsILocalFile.h"
#include "nsDirectoryService.h"
#include "nsSpecialSystemDirectory.h"
#include "nsDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsFileLocations.h"
#include "nsIFileLocator.h"
@ -173,7 +175,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.OS_CurrentProcessDirectory", NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
directoryService->Get(NS_OS_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
#ifdef XP_MAC
mFileSpec->Append("Plugins");
#else
@ -203,7 +205,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.OS_CurrentProcessDirectory", NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
directoryService->Get(NS_OS_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
}
else //In stub installer. mProgram has been set so
{
@ -216,7 +218,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.OS_TemporaryDirectory", NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
directoryService->Get(NS_OS_TEMP_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
}
break;
@ -225,7 +227,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("app.profile.user.directory.5", NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
directoryService->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
}
break;
@ -233,7 +235,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("app.prefs.directory.5", NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
directoryService->Get(NS_APP_PREFS_50_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
}
break;
@ -241,7 +243,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.OS_DriveDirectory", NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
directoryService->Get(NS_OS_DRIVE_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mFileSpec));
}
break;
@ -277,7 +279,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.OS_CurrentProcessDirectory",
directoryService->Get(NS_OS_CURRENT_PROCESS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
@ -312,7 +314,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.OS_CurrentProcessDirectory",
directoryService->Get(NS_OS_CURRENT_PROCESS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
@ -341,11 +343,12 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
}
break;
#ifdef XP_PC
case 200: /////////////////////////////////////////////////////////// Win System
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.SystemDirectory",
directoryService->Get(NS_OS_SYSTEM_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
@ -356,17 +359,19 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.WindowsDirectory",
directoryService->Get(NS_WIN_WINDOWS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
break;
#endif
#ifdef XP_MAC
case 300: /////////////////////////////////////////////////////////// Mac System
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.Directory",
directoryService->Get(NS_OS_SYSTEM_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -376,7 +381,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.DesktopDirectory",
directoryService->Get(NS_MAC_DESKTOP_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -386,7 +391,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.TrashDirectory",
directoryService->Get(NS_MAC_TRASH_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -396,7 +401,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.StartupDirectory",
directoryService->Get(NS_MAC_STARTUP_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -406,7 +411,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.ShutdownDirectory",
directoryService->Get(NS_MAC_SHUTDOWN_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -416,7 +421,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.AppleMenuDirectory",
directoryService->Get(NS_MAC_APPLE_MENU_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -426,7 +431,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.ControlPanelDirectory",
directoryService->Get(NS_MAC_CONTROL_PANELS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -436,7 +441,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.ExtensionDirectory",
directoryService->Get(NS_MAC_EXTENSIONS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -446,7 +451,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.FontsDirectory",
directoryService->Get(NS_MAC_FONTS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -456,7 +461,7 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.PreferencesDirectory",
directoryService->Get(NS_MAC_PREFS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -466,17 +471,19 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.DocumentsDirectory",
directoryService->Get(NS_MAC_DOCUMENTS_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
break;
#endif
#ifdef XP_UNIX
case 400: /////////////////////////////////////////////////////////// Unix Local
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.LocalDirectory",
directoryService->Get(NS_UNIX_LOCAL_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
@ -486,12 +493,12 @@ nsInstallFolder::SetDirectoryPath(const nsString& aFolderID, const nsString& aRe
{
NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!directoryService) return;
directoryService->Get("system.LibDirectory",
directoryService->Get(NS_UNIX_LIB_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(mFileSpec));
}
break;
#endif
case -1:
default:

View File

@ -31,6 +31,7 @@
#include "nsFileSpec.h"
#include "nsFileStream.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nspr.h"
@ -68,7 +69,7 @@ nsLoggingProgressListener::BeforeJavascriptEvaluation(const PRUnichar *URL)
NS_WITH_SERVICE(nsIProperties, dirSvc,
NS_DIRECTORY_SERVICE_PROGID, &rv);
if (!dirSvc) return NS_ERROR_FAILURE;
dirSvc->Get("system.OS_CurrentProcessDirectory", NS_GET_IID(nsIFile),
dirSvc->Get(NS_OS_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
getter_AddRefs(iFile));
}
// In stub installer

View File

@ -30,6 +30,7 @@
#include "nsInstallTrigger.h"
#include "nsIChromeRegistry.h"
#include "nsIDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
MOZ_DECL_CTOR_COUNTER(nsRegisterItem);
@ -132,7 +133,7 @@ PRInt32 nsRegisterItem::Complete()
NS_DIRECTORY_SERVICE_PROGID, &rv);
if(NS_SUCCEEDED(rv) && directoryService)
{
directoryService->Get("xpcom.currentProcess",
directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
NS_GET_IID(nsIFile), getter_AddRefs(progDir));
}
}

View File

@ -38,6 +38,7 @@
#include "NSReg.h"
#include "VerReg.h"
#include "nsIDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsInstall.h"
#include "nsSoftwareUpdateIIDs.h"
@ -144,7 +145,7 @@ nsSoftwareUpdate::nsSoftwareUpdate()
if(!directoryService) return;
nsCOMPtr<nsILocalFile> dir;
directoryService->Get("xpcom.currentProcess", NS_GET_IID(nsIFile), getter_AddRefs(dir));
directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(dir));
if (dir)
{
char* nativePath;

View File

@ -53,6 +53,7 @@
#include "nsIProxyObjectManager.h"
#include "nsIDOMWindow.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsFileLocations.h"
#include "nsProxiedService.h"
@ -621,7 +622,7 @@ nsXPInstallManager::GetDestinationFile(nsString& url, nsILocalFile* *file)
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsILocalFile> temp;
directoryService->Get("system.OS_TemporaryDirectory",
directoryService->Get(NS_OS_TEMP_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(temp));
temp->AppendUnicode(leaf.GetUnicode());