From 4353ffbaf8df5c42076704dbc9b7656a8dd46627 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Tue, 27 May 2014 16:15:36 +0200 Subject: Add several documentation stubs. Remove autogenreated TODO --- src/client/vnc/vncserver.cpp | 70 ++++++++++++++++++++++++++++++-------------- 1 file 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(); -- cgit v1.2.3-55-g7522