зеркало из https://github.com/mozilla/pjs.git
More nsIFileSpec/Locator changes (merge conflicts with profile stuff messed this up)
This commit is contained in:
Родитель
dc68739060
Коммит
dbd6f48f39
|
@ -33,6 +33,7 @@
|
|||
#include "prprf.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsIFileLocator.h"
|
||||
#include "nsIPrefWindow.h"
|
||||
#include "nsFileLocations.h"
|
||||
|
@ -328,9 +329,12 @@ int main(int argc, char* argv[])
|
|||
return NS_ERROR_FAILURE;
|
||||
|
||||
// Get current profile, make the new one a sibling...
|
||||
rv = locator->GetFileLocation(nsSpecialFileSpec::App_UserProfileDirectory50, &currProfileDirSpec);
|
||||
if (NS_FAILED(rv))
|
||||
nsIFileSpec* spec;
|
||||
rv = locator->GetFileLocation(nsSpecialFileSpec::App_UserProfileDirectory50, &spec);
|
||||
if (NS_FAILED(rv) || !spec)
|
||||
return NS_ERROR_FAILURE;
|
||||
spec->GetFileSpec(&currProfileDirSpec);
|
||||
NS_RELEASE(spec);
|
||||
currProfileDirSpec.SetLeafName(currProfileName);
|
||||
|
||||
if (locator)
|
||||
|
|
|
@ -89,25 +89,19 @@ static NS_DEFINE_IID(kProtocolHelperCID, NS_PROTOCOL_HELPER_CID);
|
|||
|
||||
nsresult NS_AutoregisterComponents()
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
nsIFileSpec* spec = NS_LocateFileOrDirectory(
|
||||
nsSpecialFileSpec::App_UserProfileDirectory50);
|
||||
if (!spec)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsFileSpec sysdir;
|
||||
rv = spec->GetFileSpec(&sysDir);
|
||||
NS_RELEASE(spec);
|
||||
char *componentsDirPath;
|
||||
nsresult rv = spec->GetNSPRPath(&componentsDirPath);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsNSPRPath componentsDir(sysdir);
|
||||
const char *componentsDirPath = (const char *) componentsDir;
|
||||
if (componentsDirPath != NULL)
|
||||
{
|
||||
if (componentsDirPath)
|
||||
rv = nsComponentManager::AutoRegister(nsIComponentManager::NS_Startup, componentsDirPath);
|
||||
}
|
||||
NS_RELEASE(spec);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче