mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
chore: make all the regexes static const
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -83,7 +83,8 @@ NewComponentDialog::~NewComponentDialog()
|
||||
void NewComponentDialog::updateDialogState()
|
||||
{
|
||||
auto protoUid = ui->nameTextBox->text().toLower();
|
||||
protoUid.remove(QRegularExpression("[^a-z]"));
|
||||
static const QRegularExpression s_removeChars("[^a-z]");
|
||||
protoUid.remove(s_removeChars);
|
||||
if (protoUid.isEmpty()) {
|
||||
ui->uidTextBox->setPlaceholderText(originalPlaceholderText);
|
||||
} else {
|
||||
|
@ -59,9 +59,9 @@ ProfileSetupDialog::ProfileSetupDialog(MinecraftAccountPtr accountToSetup, QWidg
|
||||
yellowIcon = APPLICATION->getThemedIcon("status-yellow");
|
||||
badIcon = APPLICATION->getThemedIcon("status-bad");
|
||||
|
||||
QRegularExpression permittedNames("[a-zA-Z0-9_]{3,16}");
|
||||
static const QRegularExpression s_permittedNames("[a-zA-Z0-9_]{3,16}");
|
||||
auto nameEdit = ui->nameEdit;
|
||||
nameEdit->setValidator(new QRegularExpressionValidator(permittedNames));
|
||||
nameEdit->setValidator(new QRegularExpressionValidator(s_permittedNames));
|
||||
nameEdit->setClearButtonEnabled(true);
|
||||
validityAction = nameEdit->addAction(yellowIcon, QLineEdit::LeadingPosition);
|
||||
connect(nameEdit, &QLineEdit::textEdited, this, &ProfileSetupDialog::nameEdited);
|
||||
@ -268,7 +268,6 @@ void ProfileSetupDialog::setupProfileFinished()
|
||||
QString errorMessage =
|
||||
tr("Network Error: %1\nHTTP Status: %2").arg(m_profile_task->errorString(), QString::number(m_profile_task->replyStatusCode()));
|
||||
|
||||
|
||||
if (parsedError.fullyParsed) {
|
||||
errorMessage += "Path: " + parsedError.path + "\n";
|
||||
errorMessage += "Error: " + parsedError.error + "\n";
|
||||
|
Reference in New Issue
Block a user