зеркало из https://github.com/mozilla/pjs.git
landing portions of aviary patch for bug 258123 on the trunk to keep code in sync, r=bsmedberg
This commit is contained in:
Родитель
559b5ca2f4
Коммит
e258fe4b7f
|
@ -1994,11 +1994,6 @@ int xre_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
|||
// in "components.ini" which we have just discovered changed since the
|
||||
// last time the application was run.
|
||||
RemoveComponentRegistries(lf);
|
||||
|
||||
// Tell the dir provider to supply the list of components locations
|
||||
// specified in "components.ini" when it is asked for the "ComsDL"
|
||||
// enumeration.
|
||||
dirProvider.RegisterExtraComponents();
|
||||
}
|
||||
// Nothing need be done for the normal startup case.
|
||||
}
|
||||
|
|
|
@ -89,8 +89,7 @@
|
|||
nsXREDirProvider* gDirServiceProvider = nsnull;
|
||||
|
||||
nsXREDirProvider::nsXREDirProvider() :
|
||||
mProfileNotified(PR_FALSE),
|
||||
mRegisterExtraComponents(PR_TRUE)
|
||||
mProfileNotified(PR_FALSE)
|
||||
{
|
||||
gDirServiceProvider = this;
|
||||
}
|
||||
|
@ -352,12 +351,6 @@ nsXREDirProvider::GetFile(const char* aProperty, PRBool* aPersistent,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsXREDirProvider::RegisterExtraComponents()
|
||||
{
|
||||
mRegisterExtraComponents = PR_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
LoadDirsIntoArray(nsIFile* aComponentsList, nsCOMArray<nsIFile>& aDirectories)
|
||||
{
|
||||
|
@ -394,32 +387,30 @@ nsXREDirProvider::GetFiles(const char* aProperty, nsISimpleEnumerator** aResult)
|
|||
*aResult = nsnull;
|
||||
|
||||
if (!strcmp(aProperty, NS_XPCOM_COMPONENT_DIR_LIST)) {
|
||||
if (mRegisterExtraComponents) {
|
||||
nsCOMArray<nsIFile> directories;
|
||||
|
||||
if (mXULAppDir) {
|
||||
nsCOMPtr<nsIFile> file;
|
||||
mXULAppDir->Clone(getter_AddRefs(file));
|
||||
file->AppendNative(NS_LITERAL_CSTRING("components"));
|
||||
PRBool exists;
|
||||
if (NS_SUCCEEDED(file->Exists(&exists)) && exists)
|
||||
directories.AppendObject(file);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> appFile;
|
||||
mAppDir->Clone(getter_AddRefs(appFile));
|
||||
appFile->AppendNative(NS_LITERAL_CSTRING("components.ini"));
|
||||
LoadDirsIntoArray(appFile, directories);
|
||||
|
||||
nsCOMPtr<nsIFile> profileFile;
|
||||
if (mProfileDir) {
|
||||
mProfileDir->Clone(getter_AddRefs(profileFile));
|
||||
profileFile->AppendNative(NS_LITERAL_CSTRING("components.ini"));
|
||||
LoadDirsIntoArray(profileFile, directories);
|
||||
}
|
||||
|
||||
rv = NS_NewArrayEnumerator(aResult, directories);
|
||||
nsCOMArray<nsIFile> directories;
|
||||
|
||||
if (mXULAppDir) {
|
||||
nsCOMPtr<nsIFile> file;
|
||||
mXULAppDir->Clone(getter_AddRefs(file));
|
||||
file->AppendNative(NS_LITERAL_CSTRING("components"));
|
||||
PRBool exists;
|
||||
if (NS_SUCCEEDED(file->Exists(&exists)) && exists)
|
||||
directories.AppendObject(file);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIFile> appFile;
|
||||
mAppDir->Clone(getter_AddRefs(appFile));
|
||||
appFile->AppendNative(NS_LITERAL_CSTRING("components.ini"));
|
||||
LoadDirsIntoArray(appFile, directories);
|
||||
|
||||
nsCOMPtr<nsIFile> profileFile;
|
||||
if (mProfileDir) {
|
||||
mProfileDir->Clone(getter_AddRefs(profileFile));
|
||||
profileFile->AppendNative(NS_LITERAL_CSTRING("components.ini"));
|
||||
LoadDirsIntoArray(profileFile, directories);
|
||||
}
|
||||
|
||||
rv = NS_NewArrayEnumerator(aResult, directories);
|
||||
}
|
||||
else if (!strcmp(aProperty, NS_APP_PREFS_DEFAULTS_DIR_LIST)) {
|
||||
nsCOMArray<nsIFile> directories;
|
||||
|
|
|
@ -66,13 +66,6 @@ public:
|
|||
// the responsibility of the apprunner.
|
||||
nsresult SetProfileDir(nsIFile* aProfileDir);
|
||||
|
||||
// Causes any attempts to retrieve an enumeration of directories for the
|
||||
// "ComsDL" property to return a list of directories specified in the
|
||||
// "components.ini" manifest in the profile/application directories.
|
||||
// This results in component registration at those locations during
|
||||
// XPCOM startup.
|
||||
void RegisterExtraComponents();
|
||||
|
||||
void DoShutdown();
|
||||
|
||||
nsresult GetProfileDefaultsDir(nsIFile* *aResult);
|
||||
|
@ -89,7 +82,6 @@ protected:
|
|||
nsCOMPtr<nsIFile> mXULAppDir;
|
||||
nsCOMPtr<nsIFile> mProfileDir;
|
||||
PRBool mProfileNotified;
|
||||
PRBool mRegisterExtraComponents;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче