mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 01:59:29 +00:00
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:
parent
f1a3d41f84
commit
73b4a087fd
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user