diff --git a/mozilla/xpfe/appshell/public/nsFileLocations.h b/mozilla/xpfe/appshell/public/nsFileLocations.h index 435a00f58da..562be9b4c57 100644 --- a/mozilla/xpfe/appshell/public/nsFileLocations.h +++ b/mozilla/xpfe/appshell/public/nsFileLocations.h @@ -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); diff --git a/mozilla/xpfe/appshell/src/nsFileLocations.cpp b/mozilla/xpfe/appshell/src/nsFileLocations.cpp index 54baf68e97f..b08641dd32d 100644 --- a/mozilla/xpfe/appshell/src/nsFileLocations.cpp +++ b/mozilla/xpfe/appshell/src/nsFileLocations.cpp @@ -20,6 +20,7 @@ * * Contributors: * John R. McMullen + * Seth Spitzer */ #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 /panels.rdf + nsresult rv = defaultPanelsFile.CopyToDir(*this); + NS_ASSERTION(NS_SUCCEEDED(rv), "failed to copy panels.rdf"); + if (NS_SUCCEEDED(rv)) { + // set this to /panels.rdf + *this += "panels.rdf"; + } + } + break; + } + break; case App_DirectoryBase: case App_FileBase: default: