diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-05-03 15:43:10 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-03 16:11:58 +0200 |
commit | 6dac3f18941bd2d66218ec43f08e4fb9be869c63 (patch) | |
tree | f2664c9f31d5046f38a1403f46eb0fc162d5242c /src/corelib/kernel/qcoreapplication_win.cpp | |
parent | b4dabb9e50ce26469b0b7d71e168463abf727334 (diff) | |
parent | 1e49914fee099c4c0d634743326b50ad02e6c8f1 (diff) |
Merge "Merge remote-tracking branch 'origin/api_changes'" into refs/staging/master
Diffstat (limited to 'src/corelib/kernel/qcoreapplication_win.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication_win.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 7cc1f0e286..5649a8dd76 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -141,29 +141,28 @@ public: }; // defined in qlogging.cpp -extern Q_CORE_EXPORT QByteArray qMessageFormatString(QtMsgType type, - const QMessageLogContext &context, - const char *str); +extern Q_CORE_EXPORT QString qMessageFormatString(QtMsgType type, + const QMessageLogContext &context, + const QString &str); -Q_CORE_EXPORT void qWinMessageHandler(QtMsgType t, const QMessageLogContext &context, const char *str) +Q_CORE_EXPORT void qWinMessageHandler(QtMsgType t, const QMessageLogContext &context, const QString &str) { // cannot use QMutex here, because qWarning()s in the QMutex // implementation may cause this function to recurse static QWinMsgHandlerCriticalSection staticCriticalSection; - QByteArray message = qMessageFormatString(t, context, str); - QString s(QString::fromLocal8Bit(message)); + QString message = qMessageFormatString(t, context, str); // OutputDebugString is not threadsafe. staticCriticalSection.lock(); - OutputDebugString((wchar_t*)s.utf16()); + OutputDebugString((wchar_t*)message.utf16()); staticCriticalSection.unlock(); } Q_CORE_EXPORT void qWinMsgHandler(QtMsgType t, const char *str) { QMessageLogContext emptyContext; - qWinMessageHandler(t, emptyContext, str); + qWinMessageHandler(t, emptyContext, QString::fromLocal8Bit(str)); } /***************************************************************************** @@ -189,7 +188,7 @@ void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, usingWinMain = true; // Install default debug handler - qInstallMsgHandler(qWinMsgHandler); + qInstallMessageHandler(qWinMessageHandler); // Create command line argv = qWinCmdLine<char>(cmdParam, int(strlen(cmdParam)), argc); |