From 44b3772d4d60df97bc02fe6352867ca990e4a67b Mon Sep 17 00:00:00 2001 From: "racham%netscape.com" Date: Wed, 19 Jan 2000 00:20:47 +0000 Subject: [PATCH] Fix for bug 14908. Copying the required default profile files into the migrated profile dir. r=sspitzer. git-svn-id: svn://10.0.0.236/trunk@58175 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/profile/src/nsProfile.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/mozilla/profile/src/nsProfile.cpp b/mozilla/profile/src/nsProfile.cpp index 53beef78de5..e9ae851ccd2 100644 --- a/mozilla/profile/src/nsProfile.cpp +++ b/mozilla/profile/src/nsProfile.cpp @@ -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 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;