mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
remove dependency on deprecated qt5 libraries for qt6 (#4692)
* remove dependency on deprecated qt5 libraries for qt6 removes the use of qt6-5compat for builds replaces use of QRegExp with QRegularExpression fixes incorrect usage of QRegExp removes use of QTextCodec fixes incorrect usage of QTextCodec sets qtlinguist as a required component for qt6 * fix anchoredPattern not existing in qt 5.11
This commit is contained in:
parent
f619ef23fd
commit
dec2a252fa
18 changed files with 65 additions and 75 deletions
|
|
@ -177,23 +177,23 @@ bool Servatrice_DatabaseInterface::usernameIsValid(const QString &user, QString
|
|||
return false;
|
||||
}
|
||||
|
||||
for (const QRegExp ®Exp : settingsCache->disallowedRegExp) {
|
||||
if (regExp.exactMatch(user))
|
||||
for (const QRegularExpression ®Exp : settingsCache->disallowedRegExp) {
|
||||
if (regExp.match(user).hasMatch())
|
||||
return false;
|
||||
}
|
||||
|
||||
QString regEx("[");
|
||||
QString regEx("\\A[");
|
||||
if (allowLowercase)
|
||||
regEx.append("a-z");
|
||||
if (allowUppercase)
|
||||
regEx.append("A-Z");
|
||||
if (allowNumerics)
|
||||
regEx.append("0-9");
|
||||
regEx.append(QRegExp::escape(allowedPunctuation));
|
||||
regEx.append("]+");
|
||||
regEx.append(QRegularExpression::escape(allowedPunctuation));
|
||||
regEx.append("]+\\z");
|
||||
|
||||
static QRegExp re = QRegExp(regEx);
|
||||
return re.exactMatch(user);
|
||||
QRegularExpression re = QRegularExpression(regEx);
|
||||
return re.match(user).hasMatch();
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::registerUser(const QString &userName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue