зеркало из https://github.com/mozilla/pjs.git
Added GetDefaultFolder api
This commit is contained in:
Родитель
0d0c20aaa5
Коммит
372df5c83a
|
@ -63,6 +63,9 @@ class NS_APPSHELL nsSpecialFileSpec : public nsFileSpec
|
|||
, App_ProfileDefaultsFolder30 = App_DirectoryBase + 16
|
||||
, App_ProfileDefaultsFolder40 = App_DirectoryBase + 17
|
||||
, App_ProfileDefaultsFolder50 = App_DirectoryBase + 18
|
||||
, App_PrefDefaultsFolder50 = App_DirectoryBase + 19
|
||||
|
||||
, App_DefaultsFolder50 = App_DirectoryBase + 25
|
||||
|
||||
, App_ComponentsDirectory = App_DirectoryBase + 30
|
||||
, App_ChromeDirectory = App_DirectoryBase + 31
|
||||
|
|
|
@ -198,7 +198,7 @@ static void GetDefaultUserProfileRoot(nsFileSpec& outSpec)
|
|||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
static void GetProfileDefaultsFolder(nsFileSpec& outSpec)
|
||||
static void GetDefaultsFolder(nsFileSpec& outSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsSpecialSystemDirectory cwd(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
|
||||
|
@ -210,8 +210,45 @@ static void GetProfileDefaultsFolder(nsFileSpec& outSpec)
|
|||
#endif
|
||||
|
||||
outSpec = cwd;
|
||||
} // GetDefaultsFolder
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
static void GetProfileDefaultsFolder(nsFileSpec& outSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpec cwd;
|
||||
GetDefaultsFolder(cwd);
|
||||
|
||||
if(cwd) {
|
||||
#if defined(XP_MAC)
|
||||
cwd += "Profile";
|
||||
#else
|
||||
cwd += "profile";
|
||||
#endif
|
||||
|
||||
outSpec = cwd;
|
||||
}
|
||||
} // GetProfileDefaultsFolder
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
static void GetPrefDefaultsFolder(nsFileSpec& outSpec)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
nsFileSpec cwd;
|
||||
GetDefaultsFolder(cwd);
|
||||
|
||||
if(cwd) {
|
||||
#if defined(XP_MAC)
|
||||
cwd += "Pref";
|
||||
#else
|
||||
cwd += "pref";
|
||||
#endif
|
||||
|
||||
outSpec = cwd;
|
||||
}
|
||||
} // GetProfileDefaultsFolder
|
||||
|
||||
|
||||
|
||||
//========================================================================================
|
||||
// Implementation of nsSpecialFileSpec
|
||||
|
@ -290,7 +327,10 @@ void nsSpecialFileSpec::operator = (Type aType)
|
|||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case App_DefaultsFolder50:
|
||||
GetDefaultsFolder(*this);
|
||||
break;
|
||||
case App_UserProfileDirectory30:
|
||||
case App_UserProfileDirectory40:
|
||||
NS_NOTYETIMPLEMENTED("Write me!");
|
||||
|
@ -314,6 +354,9 @@ void nsSpecialFileSpec::operator = (Type aType)
|
|||
break;
|
||||
case App_ProfileDefaultsFolder50:
|
||||
GetProfileDefaultsFolder(*this);
|
||||
break;
|
||||
case App_PrefDefaultsFolder50:
|
||||
GetPrefDefaultsFolder(*this);
|
||||
break;
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче