diff options
Diffstat (limited to 'backends/platform/sdl/win32/win32.cpp')
-rw-r--r-- | backends/platform/sdl/win32/win32.cpp | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index a116e71e76..cb65fa813a 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -278,31 +278,22 @@ Common::String OSystem_Win32::getDefaultConfigFileName() { return configFile; } -Common::WriteStream *OSystem_Win32::createLogFile() { - // Start out by resetting _logFilePath, so that in case - // of a failure, we know that no log file is open. - _logFilePath.clear(); - +Common::String OSystem_Win32::getDefaultLogFileName() { char logFile[MAXPATHLEN]; // Use the Application Data directory of the user profile. - if (SHGetFolderPathFunc(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, logFile) == S_OK) { - strcat(logFile, "\\ScummVM"); - CreateDirectory(logFile, NULL); - strcat(logFile, "\\Logs"); - CreateDirectory(logFile, NULL); - strcat(logFile, "\\scummvm.log"); - - Common::FSNode file(logFile); - Common::WriteStream *stream = file.createWriteStream(); - if (stream) - _logFilePath= logFile; - - return stream; - } else { + if (SHGetFolderPathFunc(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, logFile) != S_OK) { warning("Unable to access application data directory"); - return 0; + return Common::String(); } + + strcat(logFile, "\\ScummVM"); + CreateDirectory(logFile, NULL); + strcat(logFile, "\\Logs"); + CreateDirectory(logFile, NULL); + strcat(logFile, "\\scummvm.log"); + + return logFile; } namespace { |