From eb2bafc3d2b36f7bbb7012bee3a21bacb8cf50e2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 31 Oct 2022 15:53:01 +0100 Subject: Add a few hacks to make it compile on Qt 5.12 again --- src/client/main.cpp | 8 ++++++-- src/client/net/serverconnection.cpp | 3 ++- src/client/vnc/vncserver.cpp | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/client') diff --git a/src/client/main.cpp b/src/client/main.cpp index cb7aea6..6a7c2a0 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -2,6 +2,10 @@ #include "clientapp/clientapp.h" #include "util/util.h" +// Remove when we don't support Ubuntu 20.04 anymore +#if QT_VERSION >= QT_VERSION_CHECK(5,14,0) +#define endl Qt::endl +#endif /* instantiates the ClientApp, handles some extra parameters and starts the * main-loop of ClientApp */ @@ -13,12 +17,12 @@ int main(int argc, char** argv) /* here we handle the arguments that were not handled by ClientApp */ for (const auto &a : app.arguments()) { if (a == "--usage" || a == "--help") { - qStdout() << "Usage: pvsclient [--exam-mode] [--auto|--session=xxx|\"\"]" << Qt::endl; + qStdout() << "Usage: pvsclient [--exam-mode] [--auto|--session=xxx|\"\"]" << endl; exit(0); } else if (a.contains("pvsclient")) { /* do nothing */ } else { - qStdout() << "Unknown argument: " << a << Qt::endl; + qStdout() << "Unknown argument: " << a << endl; exit(1); } } diff --git a/src/client/net/serverconnection.cpp b/src/client/net/serverconnection.cpp index e500528..aae7538 100644 --- a/src/client/net/serverconnection.cpp +++ b/src/client/net/serverconnection.cpp @@ -25,7 +25,8 @@ ServerConnection::ServerConnection(const QString& host, const quint16 port, cons connect(_socket, &QSslSocket::encrypted, this, &ServerConnection::sock_connected); connect(_socket, &QSslSocket::readyRead, this, &ServerConnection::sock_dataArrival); connect(_socket, &QSslSocket::disconnected, this, &ServerConnection::sock_closed); - connect(_socket, &QSslSocket::errorOccurred, this, &ServerConnection::sock_error); + connect(_socket, QOverload::of(&QSslSocket::errorOccurred), + this, &ServerConnection::sock_error); connect(_socket, QOverload &>::of(&QSslSocket::sslErrors), this, &ServerConnection::sslErrors ); diff --git a/src/client/vnc/vncserver.cpp b/src/client/vnc/vncserver.cpp index 4c2363e..7db8423 100644 --- a/src/client/vnc/vncserver.cpp +++ b/src/client/vnc/vncserver.cpp @@ -13,6 +13,9 @@ #include "../util/util.h" #include "../../shared/util.h" +// Remove in future - see util.h +#undef errorOccurred + VncServer* VncServer::me = nullptr; /** -- cgit v1.2.3-55-g7522