From 9ba63d1460db41c219b638212b42476164fcfdff Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 24 Jul 2018 13:08:25 +0200 Subject: Update code style, fix compiler warnings - Use nullptr instead of NULL for better warnings in case of mistakes - Get rid of VLAs which are not in C++11 actually - Fix implicit signed <-> unsigned mismatches by adding checks and casts --- src/client/toolbar/toolbar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/toolbar/toolbar.cpp') diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index 955731a..a8e50e9 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -99,7 +99,7 @@ void Toolbar::init() setAttribute(Qt::WA_DeleteOnClose, false); /* Create the VNC Window */ - _vnc = new VncWindow(NULL); + _vnc = new VncWindow(nullptr); /* Create the connect window */ clientApp->connectWindow()->setAvailableRooms(myRooms()); @@ -353,7 +353,7 @@ void Toolbar::onVncServerIsRunning(int port) */ void Toolbar::onDisconnected(ServerConnection* connection) { - if (connection != NULL) { + if (connection != nullptr) { disconnect(connection, SIGNAL(disconnected(ServerConnection*)), this, SLOT(onDisconnected(ServerConnection*))); } _ui->lblStatus->setStyleSheet("color:red"); @@ -398,7 +398,7 @@ void Toolbar::onConnected(ServerConnection* connection) */ void Toolbar::onDoDisconnect() { - if (clientApp->connection() != NULL) + if (clientApp->connection() != nullptr) clientApp->connection()->disconnectFromServer(); } @@ -486,12 +486,12 @@ void Toolbar::showInformationDialog() void Toolbar::onBtnAttention() { - const bool on = clientApp->connection() != NULL && _ui->btnAttention->isChecked(); + const bool on = clientApp->connection() != nullptr && _ui->btnAttention->isChecked(); if (on != _ui->btnAttention->isChecked()) { _ui->btnAttention->setChecked(on); return; } - if (clientApp->connection() != NULL) { + if (clientApp->connection() != nullptr) { clientApp->connection()->sendAttention(on); } } -- cgit v1.2.3-55-g7522