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.
This commit is contained in:
sspitzer%netscape.com 1999-10-29 04:02:25 +00:00
parent f1a3d41f84
commit 73b4a087fd
2 changed files with 28 additions and 0 deletions

View File

@ -88,6 +88,7 @@ class NS_APPSHELL nsSpecialFileSpec : public nsFileSpec
, App_ImapMailDirectory50 = App_FileBase + 60
, App_NewsDirectory50 = App_FileBase + 70
, App_MessengerFolderCache50 = App_FileBase + 80
, App_UsersPanels50 = App_FileBase + 90
};
//nsSpecialFileSpec();
nsSpecialFileSpec(Type aType);

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: