summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/vnc/qvnc.cpp
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2016-06-21 12:44:31 +0200
committerAndy Nichols <andy.nichols@qt.io>2016-06-28 10:18:38 +0000
commitadf6bd931fe479b058752fb615c30c87ba661f46 (patch)
tree0a6f2d5c0001dd9e024668c4bad9026e2a55696a /src/plugins/platforms/vnc/qvnc.cpp
parent2cf3696d9f11ae2aa2dba56a0774bea10d59a482 (diff)
Add plugin arguments to VNC plugin
It is now possible to specify a port number to run the VNC server on, as well as the screen properties: Logical Size Physical Size Depth Change-Id: I79b38c6e37ad5abb5e158eca9a17d7e8a86e692f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/vnc/qvnc.cpp')
-rw-r--r--src/plugins/platforms/vnc/qvnc.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/plugins/platforms/vnc/qvnc.cpp b/src/plugins/platforms/vnc/qvnc.cpp
index c14088c2a1..743888258e 100644
--- a/src/plugins/platforms/vnc/qvnc.cpp
+++ b/src/plugins/platforms/vnc/qvnc.cpp
@@ -611,28 +611,20 @@ uint QVncClientCursor::removeClient(QVncClient *client)
}
#endif
-
-QVncServer::QVncServer(QVncScreen *screen)
- : qvnc_screen(screen)
-{
- QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
-}
-
-QVncServer::QVncServer(QVncScreen *screen, int /*id*/)
+QVncServer::QVncServer(QVncScreen *screen, quint16 port)
: qvnc_screen(screen)
+ , m_port(port)
{
QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);
}
void QVncServer::init()
{
- const int port = 5900;
-
serverSocket = new QTcpServer(this);
- if (!serverSocket->listen(QHostAddress::Any, port))
+ if (!serverSocket->listen(QHostAddress::Any, m_port))
qDebug() << "QVncServer could not connect:" << serverSocket->errorString();
else
- QT_VNC_DEBUG("QVncServer created on port %d", port);
+ QT_VNC_DEBUG("QVncServer created on port %d", m_port);
QT_VNC_DEBUG() << "running in thread" << thread() << QThread::currentThread();
connect(serverSocket, SIGNAL(newConnection()), this, SLOT(newConnection()));