From 3d82bfc698165bb20f3c38d42f2b77ab855c1edf Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Thu, 29 Sep 2016 15:40:18 +0200 Subject: astyle. --- src/client/vnc/vncwindow.cpp | 49 +++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) (limited to 'src/client/vnc/vncwindow.cpp') diff --git a/src/client/vnc/vncwindow.cpp b/src/client/vnc/vncwindow.cpp index f18fadc..818b22f 100644 --- a/src/client/vnc/vncwindow.cpp +++ b/src/client/vnc/vncwindow.cpp @@ -41,19 +41,17 @@ VncWindow::~VncWindow() */ void VncWindow::terminateVncThread() { - if(_vncWorker == NULL) + if (_vncWorker == NULL) return; _vncWorker->blockSignals(true); _vncWorker->stop(); _vncWorker = NULL; - if(_redrawTimer != 0) - { + if (_redrawTimer != 0) { killTimer(_redrawTimer); _redrawTimer = 0; } - if(_tcpTimeoutTimer != 0) - { + if (_tcpTimeoutTimer != 0) { killTimer(_tcpTimeoutTimer); _tcpTimeoutTimer = 0; } @@ -101,8 +99,8 @@ void VncWindow::open(const QString& host, int port, const QString& passwd, bool connect(_vncWorker, SIGNAL(projectionStopped()), this, SLOT(onProjectionStopped()), Qt::QueuedConnection); connect(_vncWorker, SIGNAL(projectionStarted()), this, SLOT(onProjectionStarted()), Qt::QueuedConnection); connect(_vncWorker, SIGNAL(imageUpdated(const int, const int, const int, const int)), this, - SLOT(onUpdateImage(const int, const int, const int, const int)), - Qt::QueuedConnection); + SLOT(onUpdateImage(const int, const int, const int, const int)), + Qt::QueuedConnection); setWindowTitle(caption); @@ -110,15 +108,12 @@ void VncWindow::open(const QString& host, int port, const QString& passwd, bool _remoteThumb.loadFromData(rawThumb); - if (fullscreen) - { + if (fullscreen) { setWindowFlags(Qt::WindowStaysOnTopHint); showFullScreen(); activateWindow(); raise(); - } - else - { + } else { resize(800, 600); showNormal(); } @@ -207,23 +202,18 @@ void VncWindow::onProjectionStopped() */ void VncWindow::timerEvent(QTimerEvent *event) { - if (event->timerId() == _redrawTimer) - { + if (event->timerId() == _redrawTimer) { killTimer(_redrawTimer); _redrawTimer = 0; if (this->isVisible()) this->repaint(); - } - else if (event->timerId() == _tcpTimeoutTimer) - { + } else if (event->timerId() == _tcpTimeoutTimer) { killTimer(_tcpTimeoutTimer); _tcpTimeoutTimer = 0; - if (_vncWorker != NULL && !_vncWorker->isConnected()) - { + if (_vncWorker != NULL && !_vncWorker->isConnected()) { this->close(); } - } - else + } else killTimer(event->timerId()); } @@ -237,24 +227,18 @@ void VncWindow::timerEvent(QTimerEvent *event) */ void VncWindow::paintEvent(QPaintEvent *event) { - if (_vncWorker == NULL || !_vncWorker->isConnected()) - { + if (_vncWorker == NULL || !_vncWorker->isConnected()) { QPainter painter(this); - if (!_remoteThumb.isNull() && _remoteThumb.height() > 0) - { + if (!_remoteThumb.isNull() && _remoteThumb.height() > 0) { painter.drawPixmap(0, 0, this->width(), this->height(), _remoteThumb); - } - else - { + } else { painter.fillRect(event->rect(), QColor(60, 63, 66)); } QFontInfo fi = painter.fontInfo(); painter.setPen(QColor(200, 100, 10)); painter.setFont(QFont(fi.family(), 28, fi.weight(), fi.italic())); painter.drawText(this->contentsRect(), Qt::AlignCenter, tr("Connecting...")); - } - else - { + } else { const QRect &r = event->rect(); this->draw(r.left(), r.top(), r.width(), r.height()); } @@ -268,8 +252,7 @@ void VncWindow::paintEvent(QPaintEvent *event) */ void VncWindow::resizeEvent(QResizeEvent* event) { - if (_vncWorker != NULL) - { + if (_vncWorker != NULL) { _vncWorker->setTargetSize(event->size()); } this->repaint(); -- cgit v1.2.3-55-g7522