linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06031
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3048: fix crash logs with wide char paths
------------------------------------------------------------
revno: 3048
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2012-09-13 21:56:10 +0200
message:
fix crash logs with wide char paths
modified:
win32/CrashLogger.cpp
win32/CrashLogger.h
win32/MainWindow.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'win32/CrashLogger.cpp'
--- win32/CrashLogger.cpp 2012-09-09 13:55:46 +0000
+++ win32/CrashLogger.cpp 2012-09-13 19:56:10 +0000
@@ -584,7 +584,7 @@
return EXCEPTION_CONTINUE_EXECUTION;
}
- f = fopen(CrashLogger::getPath().c_str(), "w");
+ f = _wfopen(CrashLogger::getPath().c_str(), L"w");
if(f) {
writeAppInfo();
@@ -617,6 +617,6 @@
SetUnhandledExceptionFilter(prevFilter);
}
-string CrashLogger::getPath() {
- return Util::getPath(Util::PATH_USER_LOCAL) + "CrashLog.txt";
+tstring CrashLogger::getPath() {
+ return Text::toT(Util::getPath(Util::PATH_USER_LOCAL)) + _T("CrashLog.txt");
}
=== modified file 'win32/CrashLogger.h'
--- win32/CrashLogger.h 2012-01-13 20:55:20 +0000
+++ win32/CrashLogger.h 2012-09-13 19:56:10 +0000
@@ -19,11 +19,13 @@
#ifndef DCPLUSPLUS_WIN32_CRASH_LOGGER_H
#define DCPLUSPLUS_WIN32_CRASH_LOGGER_H
+#include <dcpp/typedefs.h>
+
struct CrashLogger {
CrashLogger();
~CrashLogger();
- static string getPath();
+ static tstring getPath();
};
#endif // DCPLUSPLUS_WIN32_CRASH_LOGGER_H
=== modified file 'win32/MainWindow.cpp'
--- win32/MainWindow.cpp 2012-07-20 14:03:59 +0000
+++ win32/MainWindow.cpp 2012-09-13 19:56:10 +0000
@@ -299,7 +299,7 @@
file->appendSeparator();
file->appendItem(T_("Open downloads directory"), [this] { handleOpenDownloadsDir(); }, WinUtil::menuIcon(IDI_OPEN_DL_DIR));
- file->appendItem(T_("Open crash log"), [this] { TextFrame::openWindow(getTabView(), CrashLogger::getPath()); });
+ file->appendItem(T_("Open crash log"), [this] { TextFrame::openWindow(getTabView(), Text::fromT(CrashLogger::getPath())); });
file->appendSeparator();
file->appendItem(T_("Settings\tCtrl+F3"), [this] { handleSettings(); }, WinUtil::menuIcon(IDI_SETTINGS));