diff options
Diffstat (limited to 'backends/platform/sdl/macosx')
-rw-r--r-- | backends/platform/sdl/macosx/macosx.cpp | 23 | ||||
-rw-r--r-- | backends/platform/sdl/macosx/macosx.h | 2 |
2 files changed, 19 insertions, 6 deletions
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp index 1c47401c13..1545d9ab61 100644 --- a/backends/platform/sdl/macosx/macosx.cpp +++ b/backends/platform/sdl/macosx/macosx.cpp @@ -45,11 +45,6 @@ #include "ApplicationServices/ApplicationServices.h" // for LSOpenFSRef #include "CoreFoundation/CoreFoundation.h" // for CF* stuff -OSystem_MacOSX::OSystem_MacOSX() - : - OSystem_POSIX("Library/Preferences/ScummVM Preferences") { -} - OSystem_MacOSX::~OSystem_MacOSX() { releaseMenu(); } @@ -205,6 +200,24 @@ Common::String OSystem_MacOSX::getSystemLanguage() const { #endif // USE_DETECTLANG } +Common::String OSystem_MacOSX::getDefaultConfigFileName() { + const Common::String baseConfigName = "Library/Preferences/ScummVM Preferences"; + + Common::String configFile; + + Common::String prefix = getenv("HOME"); + + if (!prefix.empty() && (prefix.size() + 1 + baseConfigName.size()) < MAXPATHLEN) { + configFile = prefix; + configFile += '/'; + configFile += baseConfigName; + } else { + configFile = baseConfigName; + } + + return configFile; +} + Common::String OSystem_MacOSX::getDefaultLogFileName() { const char *prefix = getenv("HOME"); if (prefix == nullptr) { diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h index b860b71ad8..e4b5b2a631 100644 --- a/backends/platform/sdl/macosx/macosx.h +++ b/backends/platform/sdl/macosx/macosx.h @@ -27,7 +27,6 @@ class OSystem_MacOSX : public OSystem_POSIX { public: - OSystem_MacOSX(); ~OSystem_MacOSX(); virtual bool hasFeature(Feature f); @@ -50,6 +49,7 @@ public: virtual Common::String getScreenshotsPath(); protected: + virtual Common::String getDefaultConfigFileName(); virtual Common::String getDefaultLogFileName(); // Override createAudioCDManager() to get our Mac-specific |