fix for #16231, r=mscott. make the file locator know about panels.rdf.

if <profile>/panels.rdf doesn't exist, copy the default to that location.


git-svn-id: svn://10.0.0.236/trunk@52185 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com
1999-10-29 04:02:25 +00:00
parent 61aed8f307
commit 3441bfea68
2 changed files with 28 additions and 0 deletions

View File

@@ -20,6 +20,7 @@
*
* Contributors:
* John R. McMullen <mcmullen@netscape.com>
* Seth Spitzer <sspitzer@netscape.com>
*/
#include "nsFileLocations.h"
@@ -489,6 +490,32 @@ void nsSpecialFileSpec::operator = (Type aType)
break;
}
break;
case App_UsersPanels50:
{
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
*this += "panels.rdf";
if (!(this->Exists())) {
// find the default panels.rdf file
// something like bin/defaults/profile/panels.rdf
nsFileSpec defaultPanelsFile;
GetProfileDefaultsFolder(defaultPanelsFile);
defaultPanelsFile += "panels.rdf";
// get the users profile directory
*this = nsSpecialFileSpec(App_UserProfileDirectory50);
// copy the default panels.rdf to <profile>/panels.rdf
nsresult rv = defaultPanelsFile.CopyToDir(*this);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to copy panels.rdf");
if (NS_SUCCEEDED(rv)) {
// set this to <profile>/panels.rdf
*this += "panels.rdf";
}
}
break;
}
break;
case App_DirectoryBase:
case App_FileBase:
default: