macOS: Use standard paths

Most macOS users expect applications to store their stuff in ~/Library/Application Support
Documents is protected on newer macOSes and requires users' explicit permission (and also may be cloud synced), and use of ~/ is fairly uncommon
This commit is contained in:
TellowKrinkle 2020-12-16 16:32:07 -06:00 committed by tellowkrinkle
parent dabfff8b35
commit 5470f7ff5e
2 changed files with 7 additions and 1 deletions

View File

@ -152,7 +152,7 @@ namespace PathDefs
{
switch( mode )
{
#ifdef XDG_STD
#if defined(XDG_STD) || defined(__APPLE__) // Expected location for this kind of stuff on macOS
// Move all user data file into central configuration directory (XDG_CONFIG_DIR)
case DocsFolder_User: return GetUserLocalDataDir();
#else

View File

@ -422,6 +422,7 @@ wxMessageOutput* Pcsx2AppTraits::CreateMessageOutput()
// Pcsx2StandardPaths
// --------------------------------------------------------------------------------------
#ifdef wxUSE_STDPATHS
#ifndef __APPLE__ // macOS uses wx's defaults
class Pcsx2StandardPaths : public wxStandardPaths
{
public:
@ -462,11 +463,16 @@ public:
#endif
};
#endif // ifdef __APPLE__
wxStandardPaths& Pcsx2AppTraits::GetStandardPaths()
{
#ifdef __APPLE__
return _parent::GetStandardPaths();
#else
static Pcsx2StandardPaths stdPaths;
return stdPaths;
#endif
}
#endif