summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorSimon Rettberg2014-04-18 20:07:14 +0200
committerSimon Rettberg2014-04-18 20:07:14 +0200
commit5542a2b5a1c36411fdaa4137a439234c4a4c003e (patch)
treec1d8d7840b492dffab173257ec28d196041e2741 /src/client
parentMerge branch 'master' (diff)
downloadpvs2-5542a2b5a1c36411fdaa4137a439234c4a4c003e.tar.gz
pvs2-5542a2b5a1c36411fdaa4137a439234c4a4c003e.tar.xz
pvs2-5542a2b5a1c36411fdaa4137a439234c4a4c003e.zip
Fix comments, add (very few) documentation comments
Diffstat (limited to 'src/client')
-rw-r--r--src/client/connectwindow/connectwindow.cpp8
-rw-r--r--src/client/net/serverconnection.cpp31
-rw-r--r--src/client/toolbar/toolbar.cpp4
-rw-r--r--src/client/vnc/vncserver.cpp8
-rw-r--r--src/client/vnc/vncthread.h2
5 files changed, 42 insertions, 11 deletions
diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp
index abc33e8..ca01404 100644
--- a/src/client/connectwindow/connectwindow.cpp
+++ b/src/client/connectwindow/connectwindow.cpp
@@ -116,10 +116,14 @@ void ConnectWindow::updateState()
}
}
-/**
+/*
* Overrides
*/
+/**
+ * Called when a Qt timer fires; used for server discovery and
+ * auto-hiding the connect dialog.
+ */
void ConnectWindow::timerEvent(QTimerEvent* event)
{
if (event->timerId() == _timerDiscover)
@@ -188,7 +192,7 @@ void ConnectWindow::showEvent(QShowEvent* event)
txtName->setFocus();
}
-/**
+/*
* Slots
*/
diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp
index 6f7f22a..530701d 100644
--- a/src/client/net/serverconnection.cpp
+++ b/src/client/net/serverconnection.cpp
@@ -53,6 +53,9 @@ ServerConnection::~ServerConnection()
_blank = NULL;
}
+/**
+ * Send the given message to the server.
+ */
void ServerConnection::sendMessage(NetworkMessage& message)
{
if (_socket == NULL || _socket->state() != QAbstractSocket::ConnectedState)
@@ -64,7 +67,11 @@ void ServerConnection::sendMessage(NetworkMessage& message)
}
}
-
+/**
+ * Disconnect from current server.
+ * Do some cleanup also, like stopping any VNC server/client
+ * activity, then finally close the connection.
+ */
void ServerConnection::disconnectFromServer()
{
if (_timerDelete == 0)
@@ -82,6 +89,11 @@ void ServerConnection::disconnectFromServer()
}
}
+/**
+ * Handles an incoming message by the server.
+ * This is somewhat of a long mess, maybe split this up some day or
+ * make it OOP with a huge amount fancy features.
+ */
void ServerConnection::handleMsg()
{
_lastData = QDateTime::currentMSecsSinceEpoch() + PING_TIMEOUT_MS;
@@ -245,7 +257,7 @@ void ServerConnection::handleMsg()
}
}
-/**
+/*
* Override
*/
@@ -283,10 +295,15 @@ void ServerConnection::timerEvent(QTimerEvent *event)
killTimer(event->timerId());
}
-/**
+/*
* Slots
*/
+/**
+ * This slot is triggered by the vnc server runner once the external VNC
+ * server was succesfully started, or was terminated (either planned or
+ * crashed).
+ */
void ServerConnection::onVncServerStartStop(int port, QString& ropass, QString& rwpass)
{
_toServer.reset();
@@ -304,6 +321,10 @@ void ServerConnection::onVncServerStartStop(int port, QString& ropass, QString&
sendMessage(_toServer);
}
+/**
+ * This slot is triggered once the internal VNC viewer has started or stopped
+ * displaying a VNC stream. We'll inform the server about the state change.
+ */
void ServerConnection::onVncViewerStartStop(const bool started, const int clientId)
{
_toServer.reset();
@@ -316,6 +337,10 @@ void ServerConnection::onVncViewerStartStop(const bool started, const int client
sendMessage(_toServer);
}
+/**
+ * An ssl error happened. If it's an expected one, we ignore it
+ * and keep going. Otherwise the connection will be terminated.
+ */
void ServerConnection::sslErrors(const QList<QSslError> & errors)
{
for (QList<QSslError>::const_iterator it = errors.begin(); it != errors.end(); it++)
diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp
index 6fe7432..f016680 100644
--- a/src/client/toolbar/toolbar.cpp
+++ b/src/client/toolbar/toolbar.cpp
@@ -116,7 +116,7 @@ bool Toolbar::hideBar()
return true;
}
-/**
+/*
* Override
*/
@@ -154,7 +154,7 @@ void Toolbar::timerEvent(QTimerEvent* event)
}
}
-/**
+/*
* Slots
*/
diff --git a/src/client/vnc/vncserver.cpp b/src/client/vnc/vncserver.cpp
index 2b49b8e..82954cb 100644
--- a/src/client/vnc/vncserver.cpp
+++ b/src/client/vnc/vncserver.cpp
@@ -126,10 +126,14 @@ void VncServer::stop()
process->deleteLater();
}
-/**
+/*
* Overrides
*/
+/**
+ * Timer event, currently only used to assume VNC server setup failed
+ * after 3 seconds...
+ */
void VncServer::timerEvent(QTimerEvent *event)
{
// Error timeout (3s), tell server that vnc setup failed
@@ -137,7 +141,7 @@ void VncServer::timerEvent(QTimerEvent *event)
emit started(0, _ropass, _rwpass);
}
-/**
+/*
* Slots
*/
diff --git a/src/client/vnc/vncthread.h b/src/client/vnc/vncthread.h
index b6679b3..23530ec 100644
--- a/src/client/vnc/vncthread.h
+++ b/src/client/vnc/vncthread.h
@@ -26,7 +26,6 @@ extern "C"
}
/**
- * - START -
* Event classes. Not my code. Might be useful to implement remote assistance via VNC later.
* Code might come from the KDE VNC client.
*/
@@ -67,7 +66,6 @@ private:
int _y;
int _buttonMask;
};
-/** - END - **/
/**
* VncThread - communicate with VNC server, scale image if necessary.