diff --git a/xpfe/appshell/public/nsFileLocations.h b/xpfe/appshell/public/nsFileLocations.h index a657db3eeef..4a93557e072 100644 --- a/xpfe/appshell/public/nsFileLocations.h +++ b/xpfe/appshell/public/nsFileLocations.h @@ -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 diff --git a/xpfe/appshell/src/nsFileLocations.cpp b/xpfe/appshell/src/nsFileLocations.cpp index 7ad1e988d96..2e7a5ba2bf3 100644 --- a/xpfe/appshell/src/nsFileLocations.cpp +++ b/xpfe/appshell/src/nsFileLocations.cpp @@ -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;