SDL: Simplify implementations of getDefaultConfigFileName()
This commit is contained in:
parent
c90164f526
commit
aa083256ec
12 changed files with 33 additions and 81 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue