зеркало из https://github.com/mozilla/pjs.git
Fixing bug 100404. Backing out changes made to xpcom that caused dependency on chrome component. AccountManager in mailnews need to be fixed as explained in bug 100483 to solve the problem in a better way.
This commit is contained in:
Родитель
51c95e083c
Коммит
6bdf3511df
|
@ -32,7 +32,6 @@ LIBRARY_NAME = xpcomio_s
|
|||
REQUIRES = uconv \
|
||||
string \
|
||||
necko \
|
||||
chrome \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
#define NS_APP_CHROME_DIR "AChrom"
|
||||
#define NS_APP_PLUGINS_DIR "APlugns"
|
||||
#define NS_APP_SEARCH_DIR "SrchPlugns"
|
||||
#define NS_APP_MESSENGER_DIR "AMessenger"
|
||||
|
||||
// --------------------------------------------------------------------------------------
|
||||
// Files and directories which exist on a per-profile basis
|
||||
|
|
|
@ -30,10 +30,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
#ifndef XPCOM_STANDALONE
|
||||
#include "nsIChromeRegistry.h"
|
||||
#endif
|
||||
|
||||
#if defined(XP_MAC)
|
||||
#include <Folders.h>
|
||||
#include <Script.h>
|
||||
|
@ -97,9 +93,6 @@
|
|||
#define SEARCH_DIR_NAME "searchplugins"
|
||||
#endif
|
||||
|
||||
// default mailnews files parent folder
|
||||
#define MESSENGER_DIR_NAME "messenger"
|
||||
|
||||
//*****************************************************************************
|
||||
// nsAppFileLocationProvider::Constructor/Destructor
|
||||
//*****************************************************************************
|
||||
|
@ -113,11 +106,6 @@ nsAppFileLocationProvider::~nsAppFileLocationProvider()
|
|||
{
|
||||
}
|
||||
|
||||
// Chrome reg service
|
||||
#ifndef XPCOM_STANDALONE
|
||||
static NS_DEFINE_CID(kChromeRegistryCID, NS_CHROMEREGISTRY_CID);
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
// nsAppFileLocationProvider::nsISupports
|
||||
//*****************************************************************************
|
||||
|
@ -200,18 +188,7 @@ nsAppFileLocationProvider::GetFile(const char *prop, PRBool *persistant, nsIFile
|
|||
if (NS_SUCCEEDED(rv))
|
||||
rv = localFile->AppendRelativePath(SEARCH_DIR_NAME);
|
||||
}
|
||||
else if (nsCRT::strcmp(prop, NS_APP_MESSENGER_DIR) == 0)
|
||||
{
|
||||
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = localFile->AppendRelativePath(DEFAULTS_DIR_NAME);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = localFile->AppendRelativePath(MESSENGER_DIR_NAME);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = GetSelectedLocaleDataDir(localFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (localFile && NS_SUCCEEDED(rv))
|
||||
return localFile->QueryInterface(NS_GET_IID(nsIFile), (void**)_retval);
|
||||
|
@ -370,44 +347,3 @@ NS_METHOD nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsILocalFile **aL
|
|||
return rv;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
// GetSelectedLocaleDataDir - If a locale is selected, appends the selected locale to the
|
||||
// defaults data dir and returns that new defaults data dir
|
||||
//----------------------------------------------------------------------------------------
|
||||
NS_METHOD nsAppFileLocationProvider::GetSelectedLocaleDataDir(nsILocalFile *defaultsDataDir)
|
||||
{
|
||||
#ifndef XPCOM_STANDALONE
|
||||
NS_ENSURE_ARG_POINTER(defaultsDataDir);
|
||||
|
||||
nsresult rv;
|
||||
PRBool baseDirExists = PR_FALSE;
|
||||
rv = defaultsDataDir->Exists(&baseDirExists);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
if (baseDirExists) {
|
||||
nsCOMPtr<nsIChromeRegistry> chromeRegistry = do_GetService(kChromeRegistryCID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsXPIDLString localeName;
|
||||
nsAutoString regionKey; regionKey.AssignWithConversion("global-region");
|
||||
rv = chromeRegistry->GetSelectedLocale(regionKey.get(), getter_Copies(localeName));
|
||||
if (NS_SUCCEEDED(rv) && + localeName.get() && + nsCRT::strlen(localeName.get())) {
|
||||
PRBool localeDirExists = PR_FALSE;
|
||||
nsCOMPtr<nsIFile> localeDataDir;
|
||||
rv = defaultsDataDir->Clone(getter_AddRefs(localeDataDir));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = localeDataDir->AppendUnicode(localeName);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
rv = localeDataDir->Exists(&localeDirExists);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
if (localeDirExists) {
|
||||
// use locale provider instead
|
||||
rv = defaultsDataDir->AppendUnicode(localeName);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
#else
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ protected:
|
|||
NS_METHOD CloneMozBinDirectory(nsILocalFile **aLocalFile);
|
||||
NS_METHOD GetProductDirectory(nsILocalFile **aLocalFile);
|
||||
NS_METHOD GetDefaultUserProfileRoot(nsILocalFile **aLocalFile);
|
||||
NS_METHOD GetSelectedLocaleDataDir(nsILocalFile *aLocalFile);
|
||||
|
||||
|
||||
nsCOMPtr<nsILocalFile> mMozBinDirectory;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче