Use the 'mozProfileDirName' key from the Info.plist to decide the name of the profile directory.

This commit is contained in:
sfraser%netscape.com 2002-07-03 00:46:07 +00:00
parent 724f4ffbd7
commit a01c6063b7
4 changed files with 44 additions and 4 deletions

View File

@ -121,9 +121,19 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
// directory but causes a (harmless) warning if not defined.
setenv("MOZILLA_FIVE_HOME", binDirPath, 1);
// get the 'mozProfileDirName' key from our Info.plist file
NSString *dirString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"mozProfileDirName"];
const char* profileDirName;
if (dirString)
profileDirName = [dirString cString];
else {
NSLog(@"mozProfileDirName key missing from Info.plist file. Using default profile directory");
profileDirName = "Chimera";
}
// Supply our own directory service provider so we can control where
// the registry and profiles are located.
AppDirServiceProvider *provider = new AppDirServiceProvider(NS_LITERAL_CSTRING("Chimera"));
AppDirServiceProvider *provider = new AppDirServiceProvider(nsDependentCString(profileDirName));
NS_ASSERTION(provider, "Failed to create AppDirServiceProvider");
rv = NS_InitEmbedding(binDir, provider);
if (NS_FAILED(rv)) {

View File

@ -121,9 +121,19 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
// directory but causes a (harmless) warning if not defined.
setenv("MOZILLA_FIVE_HOME", binDirPath, 1);
// get the 'mozProfileDirName' key from our Info.plist file
NSString *dirString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"mozProfileDirName"];
const char* profileDirName;
if (dirString)
profileDirName = [dirString cString];
else {
NSLog(@"mozProfileDirName key missing from Info.plist file. Using default profile directory");
profileDirName = "Chimera";
}
// Supply our own directory service provider so we can control where
// the registry and profiles are located.
AppDirServiceProvider *provider = new AppDirServiceProvider(NS_LITERAL_CSTRING("Chimera"));
AppDirServiceProvider *provider = new AppDirServiceProvider(nsDependentCString(profileDirName));
NS_ASSERTION(provider, "Failed to create AppDirServiceProvider");
rv = NS_InitEmbedding(binDir, provider);
if (NS_FAILED(rv)) {

View File

@ -121,9 +121,19 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
// directory but causes a (harmless) warning if not defined.
setenv("MOZILLA_FIVE_HOME", binDirPath, 1);
// get the 'mozProfileDirName' key from our Info.plist file
NSString *dirString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"mozProfileDirName"];
const char* profileDirName;
if (dirString)
profileDirName = [dirString cString];
else {
NSLog(@"mozProfileDirName key missing from Info.plist file. Using default profile directory");
profileDirName = "Chimera";
}
// Supply our own directory service provider so we can control where
// the registry and profiles are located.
AppDirServiceProvider *provider = new AppDirServiceProvider(NS_LITERAL_CSTRING("Chimera"));
AppDirServiceProvider *provider = new AppDirServiceProvider(nsDependentCString(profileDirName));
NS_ASSERTION(provider, "Failed to create AppDirServiceProvider");
rv = NS_InitEmbedding(binDir, provider);
if (NS_FAILED(rv)) {

View File

@ -121,9 +121,19 @@ app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
// directory but causes a (harmless) warning if not defined.
setenv("MOZILLA_FIVE_HOME", binDirPath, 1);
// get the 'mozProfileDirName' key from our Info.plist file
NSString *dirString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"mozProfileDirName"];
const char* profileDirName;
if (dirString)
profileDirName = [dirString cString];
else {
NSLog(@"mozProfileDirName key missing from Info.plist file. Using default profile directory");
profileDirName = "Chimera";
}
// Supply our own directory service provider so we can control where
// the registry and profiles are located.
AppDirServiceProvider *provider = new AppDirServiceProvider(NS_LITERAL_CSTRING("Chimera"));
AppDirServiceProvider *provider = new AppDirServiceProvider(nsDependentCString(profileDirName));
NS_ASSERTION(provider, "Failed to create AppDirServiceProvider");
rv = NS_InitEmbedding(binDir, provider);
if (NS_FAILED(rv)) {