Fix for bug 14908. Copying the required default profile files into the migrated profile dir. r=sspitzer.

This commit is contained in:
racham%netscape.com 2000-01-19 00:20:47 +00:00
Родитель e0e6b65b83
Коммит bb2c3ad599
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -72,6 +72,9 @@
#define PREG_USERNAME "PREG_USER_NAME"
#define PREG_DENIAL "PREG_USER_DENIAL"
// hack for copying panels.rdf into migrated profile dir
#define PANELS_RDF_FILE "panels.rdf"
// kill me now.
#define REGISTRY_YES_STRING "yes"
#define REGISTRY_NO_STRING "no"
@ -1106,6 +1109,32 @@ NS_IMETHODIMP nsProfile::MigrateProfile(const char* profileName, PRBool showProg
rv = pPrefMigrator->ProcessPrefs(showProgressAsModalWindow);
if (NS_FAILED(rv)) return rv;
// Copy the default 5.0 profile files into the migrated profile
// Get profile defaults folder..
nsCOMPtr <nsIFileSpec> profDefaultsDir;
rv = locator->GetFileLocation(nsSpecialFileSpec::App_ProfileDefaultsFolder50, getter_AddRefs(profDefaultsDir));
if (NS_FAILED(rv) || !profDefaultsDir)
{
return NS_ERROR_FAILURE;
}
// Copy panels.rdf file
// This is a hack. Once the localFileSpec implementation
// is complete, this will be removed.
nsFileSpec defaultsDirSpecFile;
profDefaultsDir->GetFileSpec(&defaultsDirSpecFile);
defaultsDirSpecFile += PANELS_RDF_FILE;
if (defaultsDirSpecFile.Exists())
{
defaultsDirSpecFile.CopyToDir(newProfDir);
}
// hack finish.
rv = SetProfileDir(profileName, newProfDir);
if (NS_FAILED(rv)) return rv;