From dcfa165d8552f4e6f5de5b0c70cbf557df6a1e3e Mon Sep 17 00:00:00 2001 From: Elias Date: Sat, 15 Dec 2018 21:30:04 +0100 Subject: [PATCH] Add cleaner message output if the widgets or the wallpaper call qDebug() --- ScreenPlay/src/sdkconnector.h | 12 +++++++----- ScreenPlaySDK/screenplaysdk.cpp | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ScreenPlay/src/sdkconnector.h b/ScreenPlay/src/sdkconnector.h index da5277e6..33eb18da 100644 --- a/ScreenPlay/src/sdkconnector.h +++ b/ScreenPlay/src/sdkconnector.h @@ -48,6 +48,9 @@ public: connect(m_socket, &QLocalSocket::readyRead, this, &SDKConnection::readyRead); connect(m_socket, &QLocalSocket::disconnected, this, &SDKConnection::close); } + ~SDKConnection (){ + qDebug() << "Terminating connection object"; + } QString appID() const { @@ -77,10 +80,10 @@ public slots: //Only use the first 32 chars for the appID m_appID = msg.remove("appID=").mid(0, 32); msg.remove(m_appID); - qDebug() << "###### Wallpaper created at:"; - qDebug() << "### APPID:\t " << m_appID; // TODO << "\n### Monitor: "<< m_monitor.at(0); + qDebug() << "###### Wallpaper width APPID created:" << "\n######" << m_appID; + } else { + qDebug() << "### Message from: " << m_appID << "\n###" << msg; } - // TODO We now get all debug messages from apps here // show them inside ScreenPlay somewhere } @@ -93,8 +96,7 @@ public slots: m_socket->disconnectFromServer(); m_socket->close(); - qDebug() << "###### Destroy: "; - qDebug() << "### APPID:\t " << m_appID << " State: " << m_socket->state(); + qDebug() << "### Destroy APPID:\t " << m_appID << " State: " << m_socket->state(); } void setAppID(QString appID) diff --git a/ScreenPlaySDK/screenplaysdk.cpp b/ScreenPlaySDK/screenplaysdk.cpp index 30def78d..c5d95dbc 100644 --- a/ScreenPlaySDK/screenplaysdk.cpp +++ b/ScreenPlaySDK/screenplaysdk.cpp @@ -13,11 +13,11 @@ void redirectMessageOutputToMainWindow(QtMsgType type, const QMessageLogContext& QByteArray line = "in line " + QByteArray::number(context.line) + ", "; //QByteArray function = "function " + QByteArray(context.function) + ", Message: "; - localMsg = file + line + localMsg; + //localMsg = file + line + localMsg; switch (type) { case QtDebugMsg: - localMsg = " SDK START: " /*+ QByteArray::fromStdString(global_sdkPtr->contentType().toStdString()) + " "*/ + localMsg + " SDK END!"; + //localMsg = " SDK START: " /*+ QByteArray::fromStdString(global_sdkPtr->contentType().toStdString()) + " "*/ + localMsg; global_sdkPtr->redirectMessage(localMsg); break; case QtInfoMsg: