summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication_win.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-05-03 10:18:36 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-05-03 12:26:09 +0200
commit1e49914fee099c4c0d634743326b50ad02e6c8f1 (patch)
tree422eedb9ddcb16fa9f5a653737b4c78d8930eeae /src/corelib/kernel/qcoreapplication_win.cpp
parent1eac22a1b9dad7f843916afa9b7c820aa1c23777 (diff)
parentc0d249019b098890fb8e5e9e144c2dd8029a670c (diff)
Merge remote-tracking branch 'origin/api_changes'
Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/gui/kernel/qguiapplication.h src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow.h tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp Change-Id: I62a8805577a7940d4d36bed985eb3e7019d22f2e
Diffstat (limited to 'src/corelib/kernel/qcoreapplication_win.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp17
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);