Debugger: Use new QtMessageHandler signature
authorKai Koehne <kai.koehne@nokia.com>
Mon, 7 May 2012 12:58:26 +0000 (14:58 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 9 May 2012 00:13:54 +0000 (02:13 +0200)
Requires qtbase with change d9a1c2dff8563.

Change-Id: I11446479f8d2fce9dc5a8c914f1d1e5e3711fc57
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
src/qml/debugger/qdebugmessageservice.cpp
src/qml/debugger/qdebugmessageservice_p.h

index d44bbf9..508c068 100644 (file)
@@ -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);
index 88b918e..eac9288 100644 (file)
@@ -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);