From f010ac1da4ebdaf7317a6ee718a2eea9eca44c35 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 7 May 2012 14:58:26 +0200 Subject: [PATCH] Debugger: Use new QtMessageHandler signature Requires qtbase with change d9a1c2dff8563. Change-Id: I11446479f8d2fce9dc5a8c914f1d1e5e3711fc57 Reviewed-by: Aurindam Jana --- src/qml/debugger/qdebugmessageservice.cpp | 10 +++++----- src/qml/debugger/qdebugmessageservice_p.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qml/debugger/qdebugmessageservice.cpp b/src/qml/debugger/qdebugmessageservice.cpp index d44bbf9..508c068 100644 --- a/src/qml/debugger/qdebugmessageservice.cpp +++ b/src/qml/debugger/qdebugmessageservice.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC(QDebugMessageService, qmlDebugMessageService) void DebugMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, - const char *buf) + const QString &buf) { QDebugMessageService::instance()->sendDebugMessage(type, ctxt, buf); } @@ -64,7 +64,7 @@ public: { } - QMessageHandler oldMsgHandler; + QtMessageHandler oldMsgHandler; QQmlDebugService::State prevState; QMutex initMutex; }; @@ -91,7 +91,7 @@ QDebugMessageService *QDebugMessageService::instance() void QDebugMessageService::sendDebugMessage(QtMsgType type, const QMessageLogContext &ctxt, - const char *buf) + const QString &buf) { Q_D(QDebugMessageService); @@ -100,7 +100,7 @@ void QDebugMessageService::sendDebugMessage(QtMsgType type, //only if a client is connected to it. QByteArray message; QQmlDebugStream ws(&message, QIODevice::WriteOnly); - ws << QByteArray("MESSAGE") << type << QString::fromLocal8Bit(buf).toUtf8(); + ws << QByteArray("MESSAGE") << type << buf.toUtf8(); ws << QString::fromLatin1(ctxt.file).toUtf8(); ws << ctxt.line << QString::fromLatin1(ctxt.function).toUtf8(); @@ -115,7 +115,7 @@ void QDebugMessageService::stateChanged(State state) QMutexLocker lock(&d->initMutex); if (state != Enabled && d->prevState == Enabled) { - QMessageHandler handler = qInstallMessageHandler(d->oldMsgHandler); + QtMessageHandler handler = qInstallMessageHandler(d->oldMsgHandler); // has our handler been overwritten in between? if (handler != DebugMessageHandler) qInstallMessageHandler(handler); diff --git a/src/qml/debugger/qdebugmessageservice_p.h b/src/qml/debugger/qdebugmessageservice_p.h index 88b918e..eac9288 100644 --- a/src/qml/debugger/qdebugmessageservice_p.h +++ b/src/qml/debugger/qdebugmessageservice_p.h @@ -74,7 +74,7 @@ public: static QDebugMessageService *instance(); void sendDebugMessage(QtMsgType type, const QMessageLogContext &ctxt, - const char *buf); + const QString &buf); protected: void stateChanged(State); -- 2.7.4