aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/macosx
diff options
context:
space:
mode:
authorCameron Cawley2019-08-04 21:45:17 +0100
committerFilippos Karapetis2019-08-05 10:01:30 +0300
commit8b8fb6d3a4748ded6f47cf057fc22f9aeab225d0 (patch)
tree363e8777d147e90a75ece84e6aca42be60697dc6 /backends/platform/sdl/macosx
parentd10c69d0d1c596d4ecce9cbf967c75f3cf95a47b (diff)
downloadscummvm-rg350-8b8fb6d3a4748ded6f47cf057fc22f9aeab225d0.tar.gz
scummvm-rg350-8b8fb6d3a4748ded6f47cf057fc22f9aeab225d0.tar.bz2
scummvm-rg350-8b8fb6d3a4748ded6f47cf057fc22f9aeab225d0.zip
SDL: Simplify implementation of createLogFile()
Diffstat (limited to 'backends/platform/sdl/macosx')
-rw-r--r--backends/platform/sdl/macosx/macosx.cpp14
-rw-r--r--backends/platform/sdl/macosx/macosx.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index ae9203fd45..3628168e71 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -34,6 +34,7 @@
#include "backends/taskbar/macosx/macosx-taskbar.h"
#include "backends/dialogs/macosx/macosx-dialogs.h"
#include "backends/platform/sdl/macosx/macosx_wrapper.h"
+#include "backends/fs/posix/posix-fs.h"
#include "common/archive.h"
#include "common/config-manager.h"
@@ -198,6 +199,19 @@ Common::String OSystem_MacOSX::getSystemLanguage() const {
#endif // USE_DETECTLANG
}
+Common::String OSystem_MacOSX::getDefaultLogFileName() {
+ const char *prefix = getenv("HOME");
+ if (prefix == nullptr) {
+ return Common::String();
+ }
+
+ if (!Posix::assureDirectoryExists("Library/Logs", prefix)) {
+ return Common::String();
+ }
+
+ return Common::String(prefix) + "/Library/Logs/scummvm.log";
+}
+
Common::String OSystem_MacOSX::getScreenshotsPath() {
Common::String path = ConfMan.get("screenshotpath");
if (path.empty())
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index 6f960dbdad..b860b71ad8 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -50,6 +50,8 @@ public:
virtual Common::String getScreenshotsPath();
protected:
+ virtual Common::String getDefaultLogFileName();
+
// Override createAudioCDManager() to get our Mac-specific
// version.
virtual AudioCDManager *createAudioCDManager();