From 14be6506ee7da3b0085e1f033b95f66d17a2b8d4 Mon Sep 17 00:00:00 2001 From: Shahzain Ali Date: Mon, 28 Nov 2022 15:36:33 +0500 Subject: [PATCH] Qt5 to QT6 fixes. --- client/3rd/QtSsh/src/ssh/sshconnection.cpp | 8 ++++---- client/client.pro | 2 +- client/scripts/apple_compile.sh | 4 ++-- client/ui/uilogic.cpp | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/3rd/QtSsh/src/ssh/sshconnection.cpp b/client/3rd/QtSsh/src/ssh/sshconnection.cpp index e4403499..62e2b622 100644 --- a/client/3rd/QtSsh/src/ssh/sshconnection.cpp +++ b/client/3rd/QtSsh/src/ssh/sshconnection.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include namespace QSsh { @@ -401,14 +401,14 @@ void SshConnectionPrivate::handleServerId() // "printable US-ASCII characters, with the exception of whitespace characters // and the minus sign" QString legalString = QLatin1String("[]!\"#$!&'()*+,./0-9:;<=>?@A-Z[\\\\^_`a-z{|}~]+"); - const QRegExp versionIdpattern(QString::fromLatin1("SSH-(%1)-%1(?: .+)?.*").arg(legalString)); - if (!versionIdpattern.exactMatch(QString::fromLatin1(m_serverId))) { + const QRegularExpression versionIdpattern(QString::fromLatin1("SSH-(%1)-%1(?: .+)?.*").arg(legalString)); + if (!versionIdpattern.match(QString::fromLatin1(m_serverId)).hasMatch()) { throw SshServerException(SSH_DISCONNECT_PROTOCOL_ERROR, "Identification string is invalid.", tr("Server Identification string \"%1\" is invalid.") .arg(QString::fromLatin1(m_serverId))); } - const QString serverProtoVersion = versionIdpattern.cap(1); + const QString serverProtoVersion = versionIdpattern.match(QString::fromLatin1(m_serverId)).captured(1); if (serverProtoVersion != QLatin1String("2.0") && serverProtoVersion != QLatin1String("1.99")) { throw SshServerException(SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED, "Invalid protocol version.", diff --git a/client/client.pro b/client/client.pro index 021cf80b..84de0d9d 100644 --- a/client/client.pro +++ b/client/client.pro @@ -1,4 +1,4 @@ -QT += widgets core gui network xml remoteobjects quick svg quickcontrols2 +QT += widgets core gui network xml remoteobjects quick svg quickcontrols2 core5compat equals(QT_MAJOR_VERSION, 6): QT += core5compat TARGET = AmneziaVPN diff --git a/client/scripts/apple_compile.sh b/client/scripts/apple_compile.sh index fb44af30..48b438bb 100755 --- a/client/scripts/apple_compile.sh +++ b/client/scripts/apple_compile.sh @@ -270,6 +270,6 @@ print G "done." sed -i '' '/Original<\/string>/d' AmneziaVPN.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings fi -# print Y "Opening in XCode..." -# open AmneziaVPN.xcodeproj +print Y "Opening in XCode..." +open AmneziaVPN.xcodeproj print G "All done!" diff --git a/client/ui/uilogic.cpp b/client/ui/uilogic.cpp index 6a0b8d20..b64b47e1 100644 --- a/client/ui/uilogic.cpp +++ b/client/ui/uilogic.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "amnezia_application.h"