summaryrefslogtreecommitdiffstats
path: root/src/client/vnc/vncserver.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-05-27 16:15:36 +0200
committerManuel Schneider2014-05-27 16:15:36 +0200
commit4353ffbaf8df5c42076704dbc9b7656a8dd46627 (patch)
tree7682eb30ef964334fb34289e8634d57d46928cbe /src/client/vnc/vncserver.cpp
parentAdd several documentation stubs. Remove autogenreated TODO (diff)
downloadpvs2-4353ffbaf8df5c42076704dbc9b7656a8dd46627.tar.gz
pvs2-4353ffbaf8df5c42076704dbc9b7656a8dd46627.tar.xz
pvs2-4353ffbaf8df5c42076704dbc9b7656a8dd46627.zip
Add several documentation stubs. Remove autogenreated TODO
Diffstat (limited to 'src/client/vnc/vncserver.cpp')
-rw-r--r--src/client/vnc/vncserver.cpp70
1 files changed, 48 insertions, 22 deletions
diff --git a/src/client/vnc/vncserver.cpp b/src/client/vnc/vncserver.cpp
index 2b341fb..77beda2 100644
--- a/src/client/vnc/vncserver.cpp
+++ b/src/client/vnc/vncserver.cpp
@@ -12,12 +12,12 @@
#include "vncserver.h"
#include "../util/util.h"
-/*******************************************
- * STATIC
- *******************************************/
-
VncServer* VncServer::me = NULL;
+/***************************************************************************//**
+ * @brief VncServer::instance
+ * @return
+ */
VncServer* VncServer::instance()
{
if (me == NULL)
@@ -25,7 +25,11 @@ VncServer* VncServer::instance()
return me;
}
-//
+/***************************************************************************//**
+ * @brief makePassword
+ * @param len
+ * @return
+ */
static QString makePassword(int len = 10)
{
char pass[len];
@@ -34,27 +38,27 @@ static QString makePassword(int len = 10)
return QString::fromUtf8(pass, len);
}
-// Ugly hack to get an el-cheapo platform independent sleep
+/***************************************************************************//**
+ * @brief Ugly hack to get an el-cheapo platform independent sleep
+ */
struct Sleeper : public QThread
{
-static void msleep(unsigned long msecs) { QThread::msleep(msecs); }
+ static void msleep(unsigned long msecs) { QThread::msleep(msecs); }
};
-/*******************************************
- * INSTANCE
- *******************************************/
-
-VncServer::VncServer() :
- _process(NULL), _port(0), _timerId(0)
-{
- // TODO Auto-generated constructor stub
-}
+/***************************************************************************//**
+ * @brief VncServer::VncServer
+ */
+VncServer::VncServer() : _process(NULL), _port(0), _timerId(0){}
-VncServer::~VncServer()
-{
- // TODO Auto-generated destructor stub
-}
+/***************************************************************************//**
+ * @brief VncServer::~VncServer
+ */
+VncServer::~VncServer(){}
+/***************************************************************************//**
+ * @brief VncServer::start
+ */
void VncServer::start()
{
// Keep things clean
@@ -117,6 +121,9 @@ void VncServer::start()
_process->start("x11vnc", args, QIODevice::ReadOnly);
}
+/***************************************************************************//**
+ * @brief VncServer::stop
+ */
void VncServer::stop()
{
if (_timerId != 0)
@@ -142,13 +149,16 @@ void VncServer::stop()
process->deleteLater();
}
+
/*
* Overrides
*/
-/**
- * Timer event, currently only used to assume VNC server setup failed
+
+/***************************************************************************//**
+ * @brief Timer event, currently only used to assume VNC server setup failed
* after 3 seconds...
+ * @param event
*/
void VncServer::timerEvent(QTimerEvent *event)
{
@@ -157,10 +167,15 @@ void VncServer::timerEvent(QTimerEvent *event)
emit started(0, _ropass, _rwpass);
}
+
/*
* Slots
*/
+
+/***************************************************************************//**
+ * @brief VncServer::onStdOut
+ */
void VncServer::onStdOut()
{
if (_process == NULL)
@@ -188,6 +203,9 @@ void VncServer::onStdOut()
}
}
+/***************************************************************************//**
+ * @brief VncServer::onStdErr
+ */
void VncServer::onStdErr()
{
if (_process == NULL)
@@ -198,12 +216,20 @@ void VncServer::onStdErr()
QByteArray data(_process->readAllStandardError());
}
+/***************************************************************************//**
+ * @brief VncServer::onError
+ * @param error
+ */
void VncServer::onError(QProcess::ProcessError error)
{
this->stop();
emit started(0, _ropass, _rwpass);
}
+/***************************************************************************//**
+ * @brief VncServer::onFinished
+ * @param exitCode
+ */
void VncServer::onFinished(int exitCode)
{
this->stop();