citra_qt/multiplayer: Specify string conversions explicitly
This commit is contained in:
parent
ff931590b0
commit
8f29ab3ceb
5 changed files with 43 additions and 38 deletions
|
@ -5,6 +5,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QString>
|
||||
#include <QValidator>
|
||||
|
||||
class Validation {
|
||||
|
@ -29,18 +30,18 @@ public:
|
|||
|
||||
private:
|
||||
/// room name can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20
|
||||
QRegExp room_name_regex = QRegExp("^[a-zA-Z0-9._- ]{4,20}$");
|
||||
QRegExp room_name_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$"));
|
||||
QRegExpValidator room_name;
|
||||
|
||||
/// nickname can be alphanumeric and " " "_" "." and "-" and must have a size of 4-20
|
||||
QRegExp nickname_regex = QRegExp("^[a-zA-Z0-9._- ]{4,20}$");
|
||||
QRegExp nickname_regex = QRegExp(QStringLiteral("^[a-zA-Z0-9._- ]{4,20}$"));
|
||||
QRegExpValidator nickname;
|
||||
|
||||
/// ipv4 address only
|
||||
// TODO remove this when we support hostnames in direct connect
|
||||
QRegExp ip_regex = QRegExp(
|
||||
QRegExp ip_regex = QRegExp(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])");
|
||||
"2[0-4][0-9]|25[0-5])"));
|
||||
QRegExpValidator ip;
|
||||
|
||||
/// port must be between 0 and 65535
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue