Cleanup VNC platform plugins debug messages
There were many development debug statements still intact, so now they have been removed. Some Debug messages were turned into Warnings when it makes sense to warn the end user of something. The rest of the useful debug messages were converted to be in the qt.qpa.vnc logging catagory. Change-Id: I8e9525f02794ab5eccd4c8fcbc2b1f7c9c25b482 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
parent
adf6bd931f
commit
8d67ce3c6f
@ -53,7 +53,6 @@ public:
|
|||||||
|
|
||||||
QPlatformIntegration* QVncIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
QPlatformIntegration* QVncIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||||
{
|
{
|
||||||
QT_VNC_DEBUG() << "loading vnc plugin" << system;
|
|
||||||
if (!system.compare(QLatin1String("vnc"), Qt::CaseInsensitive))
|
if (!system.compare(QLatin1String("vnc"), Qt::CaseInsensitive))
|
||||||
return new QVncIntegration(paramList);
|
return new QVncIntegration(paramList);
|
||||||
|
|
||||||
|
@ -52,8 +52,12 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(lcVnc, "qt.qpa.vnc");
|
||||||
|
|
||||||
QVncDirtyMap::QVncDirtyMap(QVncScreen *screen)
|
QVncDirtyMap::QVncDirtyMap(QVncScreen *screen)
|
||||||
: screen(screen), bytesPerPixel(0), numDirty(0)
|
: screen(screen), bytesPerPixel(0), numDirty(0)
|
||||||
{
|
{
|
||||||
@ -456,7 +460,7 @@ void QRfbRawEncoder::write()
|
|||||||
// create a region from the dirty rects and send the region's merged rects.
|
// create a region from the dirty rects and send the region's merged rects.
|
||||||
// ### use the tile map again
|
// ### use the tile map again
|
||||||
QRegion rgn = client->dirtyRegion();
|
QRegion rgn = client->dirtyRegion();
|
||||||
QT_VNC_DEBUG() << "QRfbRawEncoder::write()" << rgn;
|
qCDebug(lcVnc) << "QRfbRawEncoder::write()" << rgn;
|
||||||
// if (map) {
|
// if (map) {
|
||||||
// for (int y = 0; y < map->mapHeight; ++y) {
|
// for (int y = 0; y < map->mapHeight; ++y) {
|
||||||
// for (int x = 0; x < map->mapWidth; ++x) {
|
// for (int x = 0; x < map->mapWidth; ++x) {
|
||||||
@ -622,10 +626,9 @@ void QVncServer::init()
|
|||||||
{
|
{
|
||||||
serverSocket = new QTcpServer(this);
|
serverSocket = new QTcpServer(this);
|
||||||
if (!serverSocket->listen(QHostAddress::Any, m_port))
|
if (!serverSocket->listen(QHostAddress::Any, m_port))
|
||||||
qDebug() << "QVncServer could not connect:" << serverSocket->errorString();
|
qWarning() << "QVncServer could not connect:" << serverSocket->errorString();
|
||||||
else
|
else
|
||||||
QT_VNC_DEBUG("QVncServer created on port %d", m_port);
|
qWarning("QVncServer created on port %d", m_port);
|
||||||
QT_VNC_DEBUG() << "running in thread" << thread() << QThread::currentThread();
|
|
||||||
|
|
||||||
connect(serverSocket, SIGNAL(newConnection()), this, SLOT(newConnection()));
|
connect(serverSocket, SIGNAL(newConnection()), this, SLOT(newConnection()));
|
||||||
|
|
||||||
@ -654,7 +657,7 @@ void QVncServer::newConnection()
|
|||||||
|
|
||||||
dirtyMap()->reset();
|
dirtyMap()->reset();
|
||||||
|
|
||||||
QT_VNC_DEBUG() << "new Connection" << thread();
|
qCDebug(lcVnc) << "new Connection from: " << clientSocket->localAddress();
|
||||||
|
|
||||||
qvnc_screen->setPowerState(QPlatformScreen::PowerStateOn);
|
qvnc_screen->setPowerState(QPlatformScreen::PowerStateOn);
|
||||||
}
|
}
|
||||||
|
@ -40,21 +40,17 @@
|
|||||||
#ifndef QVNC_P_H
|
#ifndef QVNC_P_H
|
||||||
#define QVNC_P_H
|
#define QVNC_P_H
|
||||||
|
|
||||||
#include <QtCore/qdebug.h>
|
|
||||||
#if 0
|
|
||||||
#define QT_VNC_DEBUG if (1) {} else qDebug
|
|
||||||
#else
|
|
||||||
#define QT_VNC_DEBUG qDebug
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "qvncscreen.h"
|
#include "qvncscreen.h"
|
||||||
|
|
||||||
|
#include <QtCore/QLoggingCategory>
|
||||||
#include <QtCore/qbytearray.h>
|
#include <QtCore/qbytearray.h>
|
||||||
#include <QtCore/qvarlengtharray.h>
|
#include <QtCore/qvarlengtharray.h>
|
||||||
#include <qpa/qplatformcursor.h>
|
#include <qpa/qplatformcursor.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(lcVnc)
|
||||||
|
|
||||||
class QTcpSocket;
|
class QTcpSocket;
|
||||||
class QTcpServer;
|
class QTcpServer;
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ void QVncClient::convertPixels(char *dst, const char *src, int count) const
|
|||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
r = g = b = 0;
|
r = g = b = 0;
|
||||||
qDebug("QVNCServer: don't support %dbpp display", screendepth);
|
qWarning("QVNCServer: don't support %dbpp display", screendepth);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ void QVncClient::convertPixels(char *dst, const char *src, int count) const
|
|||||||
((pixel & 0x000000ff) << 24));
|
((pixel & 0x000000ff) << 24));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug("Cannot handle %d bpp client", m_pixelFormat.bitsPerPixel);
|
qWarning("Cannot handle %d bpp client", m_pixelFormat.bitsPerPixel);
|
||||||
}
|
}
|
||||||
} else { // QSysInfo::ByteOrder == QSysInfo::LittleEndian
|
} else { // QSysInfo::ByteOrder == QSysInfo::LittleEndian
|
||||||
switch (m_pixelFormat.bitsPerPixel) {
|
switch (m_pixelFormat.bitsPerPixel) {
|
||||||
@ -248,7 +248,7 @@ void QVncClient::convertPixels(char *dst, const char *src, int count) const
|
|||||||
((pixel & 0x000000ff) << 24));
|
((pixel & 0x000000ff) << 24));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug("Cannot handle %d bpp client",
|
qWarning("Cannot handle %d bpp client",
|
||||||
m_pixelFormat.bitsPerPixel);
|
m_pixelFormat.bitsPerPixel);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ void QVncClient::convertPixels(char *dst, const char *src, int count) const
|
|||||||
|
|
||||||
void QVncClient::readClient()
|
void QVncClient::readClient()
|
||||||
{
|
{
|
||||||
QT_VNC_DEBUG() << "readClient" << m_state;
|
qCDebug(lcVnc) << "readClient" << m_state;
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case Disconnected:
|
case Disconnected:
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ void QVncClient::readClient()
|
|||||||
char proto[13];
|
char proto[13];
|
||||||
m_clientSocket->read(proto, 12);
|
m_clientSocket->read(proto, 12);
|
||||||
proto[12] = '\0';
|
proto[12] = '\0';
|
||||||
QT_VNC_DEBUG("Client protocol version %s", proto);
|
qCDebug(lcVnc, "Client protocol version %s", proto);
|
||||||
if (!strcmp(proto, "RFB 003.008\n")) {
|
if (!strcmp(proto, "RFB 003.008\n")) {
|
||||||
m_protocolVersion = V3_8;
|
m_protocolVersion = V3_8;
|
||||||
} else if (!strcmp(proto, "RFB 003.007\n")) {
|
} else if (!strcmp(proto, "RFB 003.007\n")) {
|
||||||
@ -392,7 +392,7 @@ void QVncClient::readClient()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qDebug("QVNC cannot drive depth %d", m_server->screen()->depth());
|
qWarning("QVNC cannot drive depth %d", m_server->screen()->depth());
|
||||||
discardClient();
|
discardClient();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -416,7 +416,7 @@ void QVncClient::readClient()
|
|||||||
setPixelFormat();
|
setPixelFormat();
|
||||||
break;
|
break;
|
||||||
case FixColourMapEntries:
|
case FixColourMapEntries:
|
||||||
qDebug("Not supported: FixColourMapEntries");
|
qWarning("Not supported: FixColourMapEntries");
|
||||||
m_handleMsg = false;
|
m_handleMsg = false;
|
||||||
break;
|
break;
|
||||||
case SetEncodings:
|
case SetEncodings:
|
||||||
@ -435,7 +435,7 @@ void QVncClient::readClient()
|
|||||||
clientCutText();
|
clientCutText();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug("Unknown message type: %d", (int)m_msgType);
|
qWarning("Unknown message type: %d", (int)m_msgType);
|
||||||
m_handleMsg = false;
|
m_handleMsg = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -496,7 +496,7 @@ void QVncClient::setPixelFormat()
|
|||||||
char buf[3];
|
char buf[3];
|
||||||
m_clientSocket->read(buf, 3); // just padding
|
m_clientSocket->read(buf, 3); // just padding
|
||||||
m_pixelFormat.read(m_clientSocket);
|
m_pixelFormat.read(m_clientSocket);
|
||||||
QT_VNC_DEBUG("Want format: %d %d %d %d %d %d %d %d %d %d",
|
qCDebug(lcVnc, "Want format: %d %d %d %d %d %d %d %d %d %d",
|
||||||
int(m_pixelFormat.bitsPerPixel),
|
int(m_pixelFormat.bitsPerPixel),
|
||||||
int(m_pixelFormat.depth),
|
int(m_pixelFormat.depth),
|
||||||
int(m_pixelFormat.bigEndian),
|
int(m_pixelFormat.bigEndian),
|
||||||
@ -508,7 +508,7 @@ void QVncClient::setPixelFormat()
|
|||||||
int(m_pixelFormat.greenShift),
|
int(m_pixelFormat.greenShift),
|
||||||
int(m_pixelFormat.blueShift));
|
int(m_pixelFormat.blueShift));
|
||||||
if (!m_pixelFormat.trueColor) {
|
if (!m_pixelFormat.trueColor) {
|
||||||
qDebug("Can only handle true color clients");
|
qWarning("Can only handle true color clients");
|
||||||
discardClient();
|
discardClient();
|
||||||
}
|
}
|
||||||
m_handleMsg = false;
|
m_handleMsg = false;
|
||||||
@ -552,12 +552,12 @@ void QVncClient::setEncodings()
|
|||||||
qint32 enc;
|
qint32 enc;
|
||||||
m_clientSocket->read((char *)&enc, sizeof(qint32));
|
m_clientSocket->read((char *)&enc, sizeof(qint32));
|
||||||
enc = ntohl(enc);
|
enc = ntohl(enc);
|
||||||
QT_VNC_DEBUG("QVncServer::setEncodings: %d", enc);
|
qCDebug(lcVnc, "QVncServer::setEncodings: %d", enc);
|
||||||
switch (enc) {
|
switch (enc) {
|
||||||
case Raw:
|
case Raw:
|
||||||
if (!m_encoder) {
|
if (!m_encoder) {
|
||||||
m_encoder = new QRfbRawEncoder(this);
|
m_encoder = new QRfbRawEncoder(this);
|
||||||
QT_VNC_DEBUG("QVncServer::setEncodings: using raw");
|
qCDebug(lcVnc, "QVncServer::setEncodings: using raw");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CopyRect:
|
case CopyRect:
|
||||||
@ -579,7 +579,6 @@ void QVncClient::setEncodings()
|
|||||||
break;
|
break;
|
||||||
case Cursor:
|
case Cursor:
|
||||||
m_supportCursor = true;
|
m_supportCursor = true;
|
||||||
qDebug() << "client side cursor supported.";
|
|
||||||
m_server->screen()->enableClientCursor(this);
|
m_server->screen()->enableClientCursor(this);
|
||||||
break;
|
break;
|
||||||
case DesktopSize:
|
case DesktopSize:
|
||||||
@ -595,13 +594,13 @@ void QVncClient::setEncodings()
|
|||||||
|
|
||||||
if (!m_encoder) {
|
if (!m_encoder) {
|
||||||
m_encoder = new QRfbRawEncoder(this);
|
m_encoder = new QRfbRawEncoder(this);
|
||||||
QT_VNC_DEBUG("QVncServer::setEncodings: fallback using raw");
|
qCDebug(lcVnc, "QVncServer::setEncodings: fallback using raw");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QVncClient::frameBufferUpdateRequest()
|
void QVncClient::frameBufferUpdateRequest()
|
||||||
{
|
{
|
||||||
QT_VNC_DEBUG() << "FramebufferUpdateRequest";
|
qCDebug(lcVnc) << "FramebufferUpdateRequest";
|
||||||
QRfbFrameBufferUpdateRequest ev;
|
QRfbFrameBufferUpdateRequest ev;
|
||||||
|
|
||||||
if (ev.read(m_clientSocket)) {
|
if (ev.read(m_clientSocket)) {
|
||||||
|
@ -83,9 +83,7 @@ bool QVncScreen::initialize()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QFbScreen::initializeCompositor();
|
QFbScreen::initializeCompositor();
|
||||||
QT_VNC_DEBUG() << "QVncScreen::init" << geometry();
|
|
||||||
|
|
||||||
switch (depth()) {
|
switch (depth()) {
|
||||||
case 32:
|
case 32:
|
||||||
@ -112,7 +110,6 @@ bool QVncScreen::initialize()
|
|||||||
QRegion QVncScreen::doRedraw()
|
QRegion QVncScreen::doRedraw()
|
||||||
{
|
{
|
||||||
QRegion touched = QFbScreen::doRedraw();
|
QRegion touched = QFbScreen::doRedraw();
|
||||||
QT_VNC_DEBUG() << "qvncscreen::doRedraw()" << touched.rectCount();
|
|
||||||
|
|
||||||
if (touched.isEmpty())
|
if (touched.isEmpty())
|
||||||
return touched;
|
return touched;
|
||||||
|
Loading…
Reference in New Issue
Block a user