QDebugMessageService::QDebugMessageService(QObject *parent) :
QDeclarativeDebugService(*(new QDebugMessageServicePrivate()),
- QLatin1String("DebugMessages"), 1, parent)
+ QLatin1String("DebugMessages"), 2, parent)
{
Q_D(QDebugMessageService);
//We do not want to alter the message handling mechanism
//We just eavesdrop and forward the messages to a port
//only if a client is connected to it.
- QByteArray debugMessage;
- QDataStream rs(&debugMessage, QIODevice::WriteOnly);
- rs << type << QString::fromLocal8Bit(buf).toUtf8();
-
QByteArray message;
QDataStream ws(&message, QIODevice::WriteOnly);
- ws << QByteArray("MESSAGE") << debugMessage;
+ ws << QByteArray("MESSAGE") << type << QString::fromLocal8Bit(buf).toUtf8();
sendMessage(message);
if (d->oldMsgHandler)
ds >> command;
if (command == "MESSAGE") {
- QByteArray container;
- ds >> container;
-
- QVERIFY(ds.atEnd());
-
- QDataStream containerDs(container);
int type;
QByteArray message;
- containerDs >> type >> message;
- QVERIFY(containerDs.atEnd());
+ ds >> type >> message;
+ QVERIFY(ds.atEnd());
QVERIFY(type >= QtDebugMsg);
QVERIFY(type <= QtFatalMsg);