зеркало из https://github.com/mozilla/pjs.git
Added new file spec for profile defaults folder
This commit is contained in:
Родитель
31d5a62283
Коммит
19b53ef7bf
|
@ -58,6 +58,9 @@ class NS_APPSHELL nsSpecialFileSpec : public nsFileSpec
|
|||
, App_DefaultUserProfileRoot30 = App_DirectoryBase + 13
|
||||
, App_DefaultUserProfileRoot40 = App_DirectoryBase + 14
|
||||
, App_DefaultUserProfileRoot50 = App_DirectoryBase + 15
|
||||
, App_ProfileDefaultsFolder30 = App_DirectoryBase + 16
|
||||
, App_ProfileDefaultsFolder40 = App_DirectoryBase + 17
|
||||
, App_ProfileDefaultsFolder50 = App_DirectoryBase + 18
|
||||
|
||||
, App_ComponentsDirectory = App_DirectoryBase + 30
|
||||
, App_ChromeDirectory = App_DirectoryBase + 31
|
||||
|
|
|
@ -197,6 +197,51 @@ static void GetDefaultUserProfileRoot(nsFileSpec& outSpec)
|
|||
} // GetDefaultUserProfileRoot
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
static void GetProfileDefaultsFolder(nsFileSpec& outSpec)
|
||||
// UNIX : ~/.mozilla/ProfileDefaults
|
||||
// WIN : Program Files\Netscape\ProfileDefaults
|
||||
// Mac : :Documents:Mozilla:ProfileDefaults:
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
#if defined(XP_MAC)
|
||||
nsSpecialSystemDirectory cwd(nsSpecialSystemDirectory::Mac_DocumentsDirectory);
|
||||
cwd += "Mozilla";
|
||||
if (!cwd.Exists())
|
||||
cwd.CreateDir();
|
||||
|
||||
#elif defined(XP_UNIX)
|
||||
nsSpecialSystemDirectory cwd(nsSpecialSystemDirectory::Unix_HomeDirectory);
|
||||
cwd += ".mozilla";
|
||||
if (!cwd.Exists())
|
||||
cwd.CreateDir();
|
||||
|
||||
#elif defined(XP_PC)
|
||||
// set its directory an aunt of the executable.
|
||||
nsSpecialSystemDirectory cwd(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
|
||||
// That's "program files\Netscape\Communicator\Program"
|
||||
nsFileSpec parent;
|
||||
cwd.GetParent(parent); // "program files\Netscape\Communicator"
|
||||
parent.GetParent(cwd); // "program files\Netscape\"
|
||||
|
||||
#elif defined(XP_BEOS)
|
||||
nsSpecialSystemDirectory cwd(nsSpecialSystemDirectory::BeOS_SettingsDirectory);
|
||||
cwd += "mozilla";
|
||||
if (!cwd.Exists())
|
||||
cwd.CreateDir();
|
||||
|
||||
#else
|
||||
#error dont_know_how_to_do_profiles_on_your_platform
|
||||
#endif
|
||||
|
||||
cwd += "ProfileDefaults";
|
||||
if (!cwd.Exists())
|
||||
cwd.CreateDir();
|
||||
|
||||
outSpec = cwd;
|
||||
} // GetProfileDefaultsFolder
|
||||
|
||||
|
||||
//========================================================================================
|
||||
// Implementation of nsSpecialFileSpec
|
||||
//========================================================================================
|
||||
|
@ -280,6 +325,15 @@ void nsSpecialFileSpec::operator = (Type aType)
|
|||
case App_DefaultUserProfileRoot50:
|
||||
GetDefaultUserProfileRoot(*this);
|
||||
break;
|
||||
|
||||
case App_ProfileDefaultsFolder30:
|
||||
case App_ProfileDefaultsFolder40:
|
||||
NS_NOTYETIMPLEMENTED("Write me!");
|
||||
break;
|
||||
case App_ProfileDefaultsFolder50:
|
||||
GetProfileDefaultsFolder(*this);
|
||||
break;
|
||||
|
||||
|
||||
case App_PreferencesFile30:
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче