diff options
Diffstat (limited to 'src/yuzu/multiplayer')
| -rw-r--r-- | src/yuzu/multiplayer/direct_connect.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/multiplayer/validation.h | 16 | 
2 files changed, 10 insertions, 8 deletions
| diff --git a/src/yuzu/multiplayer/direct_connect.cpp b/src/yuzu/multiplayer/direct_connect.cpp index 10bf0a4fb..cbd52da85 100644 --- a/src/yuzu/multiplayer/direct_connect.cpp +++ b/src/yuzu/multiplayer/direct_connect.cpp @@ -4,7 +4,7 @@  #include <QComboBox>  #include <QFuture>  #include <QIntValidator> -#include <QRegExpValidator> +#include <QRegularExpressionValidator>  #include <QString>  #include <QtConcurrent/QtConcurrentRun>  #include "common/settings.h" diff --git a/src/yuzu/multiplayer/validation.h b/src/yuzu/multiplayer/validation.h index dabf860be..dd25af280 100644 --- a/src/yuzu/multiplayer/validation.h +++ b/src/yuzu/multiplayer/validation.h @@ -3,7 +3,7 @@  #pragma once -#include <QRegExp> +#include <QRegularExpression>  #include <QString>  #include <QValidator> @@ -29,19 +29,21 @@ public:  private:      /// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 -    QRegExp room_name_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); -    QRegExpValidator room_name; +    QRegularExpression room_name_regex = +        QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); +    QRegularExpressionValidator room_name;      /// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20 -    QRegExp nickname_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$")); -    QRegExpValidator nickname; +    const QRegularExpression nickname_regex = +        QRegularExpression(QStringLiteral("^[a-zA-Z0-9._ -]{4,20}")); +    QRegularExpressionValidator nickname;      /// ipv4 address only      // TODO remove this when we support hostnames in direct connect -    QRegExp ip_regex = QRegExp(QStringLiteral( +    QRegularExpression ip_regex = QRegularExpression(QStringLiteral(          "(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|"          "2[0-4][0-9]|25[0-5])")); -    QRegExpValidator ip; +    QRegularExpressionValidator ip;      /// port must be between 0 and 65535      QIntValidator port; | 
