From: Kai Koehne Date: Mon, 7 May 2012 12:58:26 +0000 (+0200) Subject: Debugger: Use new QtMessageHandler signature X-Git-Tag: upstream/5.2.1~1930 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f010ac1da4ebdaf7317a6ee718a2eea9eca44c35;p=platform%2Fupstream%2Fqtdeclarative.git Debugger: Use new QtMessageHandler signature Requires qtbase with change d9a1c2dff8563. Change-Id: I11446479f8d2fce9dc5a8c914f1d1e5e3711fc57 Reviewed-by: Aurindam Jana --- 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);