Merge branch 'qt_migration' into qmake-to-cmake-migration

This commit is contained in:
Shahzain Ali 2022-11-28 19:23:28 +05:00
commit a0b5491178
5 changed files with 10 additions and 9 deletions

View file

@ -67,7 +67,7 @@ a "`qmake` cannot be found in your `$PATH`" error. In this case run this script
using QT\IOS\_BIN env to set the path for the Qt5 macos build bin folder. using QT\IOS\_BIN env to set the path for the Qt5 macos build bin folder.
For example, the path could look like this: For example, the path could look like this:
```bash ```bash
QT_IOS_BIN="/Users/username/Qt/5.15.2/ios/bin" ./scripts/apple_compile.sh ios QT_IOS_BIN="/Users/username/Qt/6.4.1/ios/bin" ./scripts/apple_compile.sh ios
``` ```
If you get `gomobile: command not found` make sure to set PATH to the location If you get `gomobile: command not found` make sure to set PATH to the location

View file

@ -47,7 +47,7 @@
#include <QMutex> #include <QMutex>
#include <QMutexLocker> #include <QMutexLocker>
#include <QNetworkProxy> #include <QNetworkProxy>
#include <QRegExp> #include <QRegularExpression>
#include <QTcpSocket> #include <QTcpSocket>
namespace QSsh { namespace QSsh {
@ -401,14 +401,14 @@ void SshConnectionPrivate::handleServerId()
// "printable US-ASCII characters, with the exception of whitespace characters // "printable US-ASCII characters, with the exception of whitespace characters
// and the minus sign" // and the minus sign"
QString legalString = QLatin1String("[]!\"#$!&'()*+,./0-9:;<=>?@A-Z[\\\\^_`a-z{|}~]+"); QString legalString = QLatin1String("[]!\"#$!&'()*+,./0-9:;<=>?@A-Z[\\\\^_`a-z{|}~]+");
const QRegExp versionIdpattern(QString::fromLatin1("SSH-(%1)-%1(?: .+)?.*").arg(legalString)); const QRegularExpression versionIdpattern(QString::fromLatin1("SSH-(%1)-%1(?: .+)?.*").arg(legalString));
if (!versionIdpattern.exactMatch(QString::fromLatin1(m_serverId))) { if (!versionIdpattern.match(QString::fromLatin1(m_serverId)).hasMatch()) {
throw SshServerException(SSH_DISCONNECT_PROTOCOL_ERROR, throw SshServerException(SSH_DISCONNECT_PROTOCOL_ERROR,
"Identification string is invalid.", "Identification string is invalid.",
tr("Server Identification string \"%1\" is invalid.") tr("Server Identification string \"%1\" is invalid.")
.arg(QString::fromLatin1(m_serverId))); .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")) { if (serverProtoVersion != QLatin1String("2.0") && serverProtoVersion != QLatin1String("1.99")) {
throw SshServerException(SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED, throw SshServerException(SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED,
"Invalid protocol version.", "Invalid protocol version.",

View file

@ -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 equals(QT_MAJOR_VERSION, 6): QT += core5compat
TARGET = AmneziaVPN TARGET = AmneziaVPN
@ -353,7 +353,7 @@ ios {
message("Building for iPhone OS") message("Building for iPhone OS")
QMAKE_TARGET_BUNDLE_PREFIX = org.amnezia QMAKE_TARGET_BUNDLE_PREFIX = org.amnezia
QMAKE_BUNDLE = AmneziaVPN QMAKE_BUNDLE = AmneziaVPN
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0 QMAKE_IOS_DEPLOYMENT_TARGET = 13.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1 QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1
QMAKE_DEVELOPMENT_TEAM = X7UJ388FXK QMAKE_DEVELOPMENT_TEAM = X7UJ388FXK
QMAKE_PROVISIONING_PROFILE = f2fefb59-14aa-4aa9-ac14-1d5531b06dcc QMAKE_PROVISIONING_PROFILE = f2fefb59-14aa-4aa9-ac14-1d5531b06dcc

View file

@ -270,6 +270,6 @@ print G "done."
sed -i '' '/<string>Original<\/string>/d' AmneziaVPN.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings sed -i '' '/<string>Original<\/string>/d' AmneziaVPN.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
fi fi
# print Y "Opening in XCode..." print Y "Opening in XCode..."
# open AmneziaVPN.xcodeproj open AmneziaVPN.xcodeproj
print G "All done!" print G "All done!"

View file

@ -17,6 +17,7 @@
#include <QTimer> #include <QTimer>
#include <QQmlFile> #include <QQmlFile>
#include <QMetaObject> #include <QMetaObject>
#include <QStandardPaths>
#include "amnezia_application.h" #include "amnezia_application.h"