aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/sdl.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2010-11-29 18:30:23 +0000
committerJohannes Schickel2010-11-29 18:30:23 +0000
commit39aad6ece718acb39ad38ba5858f2aeeb5c29474 (patch)
tree1e962555638267bf675dc4ec4d26791441c5c9f5 /backends/platform/sdl/sdl.cpp
parent91a6b7f5372bfb93a1a7816ea1b7f3a5c65164fd (diff)
downloadscummvm-rg350-39aad6ece718acb39ad38ba5858f2aeeb5c29474.tar.gz
scummvm-rg350-39aad6ece718acb39ad38ba5858f2aeeb5c29474.tar.bz2
scummvm-rg350-39aad6ece718acb39ad38ba5858f2aeeb5c29474.zip
SDL: Move createLogFile implementions to the OSystem_SDL subclasses.
svn-id: r54581
Diffstat (limited to 'backends/platform/sdl/sdl.cpp')
-rw-r--r--backends/platform/sdl/sdl.cpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 82ff537c51..dc91bd9fe7 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -47,12 +47,6 @@
#include <time.h> // for getTimeAndDate()
-// For logging
-#ifdef UNIX
-#include <errno.h>
-#include <sys/stat.h>
-#endif
-
#ifdef USE_DETECTLANG
#ifndef WIN32
#include <locale.h>
@@ -254,94 +248,6 @@ Common::WriteStream *OSystem_SDL::createConfigWriteStream() {
return file.createWriteStream();
}
-#define DEFAULT_LOG_FILE "scummvm.log"
-
-Common::WriteStream *OSystem_SDL::createLogFile() {
-#if defined(MACOSX)
- return 0;
-#elif defined(UNIX)
- const char *home = getenv("HOME");
- if (home == NULL)
- return 0;
-
- Common::String logFile(home);
- logFile += "/.scummvm";
-
- struct stat sb;
-
- // Check whether the dir exists
- if (stat(logFile.c_str(), &sb) == -1) {
- // The dir does not exist, or stat failed for some other reason.
- if (errno != ENOENT)
- return 0;
-
- // If the problem was that the path pointed to nothing, try
- // to create the dir.
- if (mkdir(logFile.c_str(), 0755) != 0)
- return 0;
- } else if (!S_ISDIR(sb.st_mode)) {
- // Path is no directory. Oops
- return 0;
- }
-
- logFile += "/logs";
-
- // Check whether the dir exists
- if (stat(logFile.c_str(), &sb) == -1) {
- // The dir does not exist, or stat failed for some other reason.
- if (errno != ENOENT)
- return 0;
-
- // If the problem was that the path pointed to nothing, try
- // to create the dir.
- if (mkdir(logFile.c_str(), 0755) != 0)
- return 0;
- } else if (!S_ISDIR(sb.st_mode)) {
- // Path is no directory. Oops
- return 0;
- }
-
- logFile += "/" DEFAULT_LOG_FILE;
-
- Common::FSNode file(logFile);
- return file.createWriteStream();
-#elif defined (WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
- char logFile[MAXPATHLEN];
-
- OSVERSIONINFO win32OsVersion;
- ZeroMemory(&win32OsVersion, sizeof(OSVERSIONINFO));
- win32OsVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&win32OsVersion);
- // Check for non-9X version of Windows.
- if (win32OsVersion.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS) {
- // Use the Application Data directory of the user profile.
- if (win32OsVersion.dwMajorVersion >= 5) {
- if (!GetEnvironmentVariable("APPDATA", logFile, sizeof(logFile)))
- error("Unable to access application data directory");
- } else {
- if (!GetEnvironmentVariable("USERPROFILE", logFile, sizeof(logFile)))
- error("Unable to access user profile directory");
-
- strcat(logFile, "\\Application Data");
- CreateDirectory(logFile, NULL);
- }
-
- strcat(logFile, "\\ScummVM");
- CreateDirectory(logFile, NULL);
- strcat(logFile, "\\Logs");
- CreateDirectory(logFile, NULL);
- strcat(logFile, "\\" DEFAULT_LOG_FILE);
-
- Common::FSNode file(logFile);
- return file.createWriteStream();
- } else {
- return 0;
- }
-#else
- return 0;
-#endif
-}
-
void OSystem_SDL::setWindowCaption(const char *caption) {
Common::String cap;
byte c;