mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
Merge branch 'noanchor' into 'master'
Replace usage of QRegularExpression::anchoredPattern with `^` and `$` See merge request OpenMW/openmw!2607
This commit is contained in:
commit
b7e5759599
@ -205,7 +205,7 @@ void Launcher::GraphicsPage::saveSettings()
|
||||
int cHeight = 0;
|
||||
if (standardRadioButton->isChecked())
|
||||
{
|
||||
QRegularExpression resolutionRe(QRegularExpression::anchoredPattern(QString("(\\d+) x (\\d+).*")));
|
||||
QRegularExpression resolutionRe("^(\\d+) x (\\d+)");
|
||||
QRegularExpressionMatch match = resolutionRe.match(resolutionComboBox->currentText().simplified());
|
||||
if (match.hasMatch())
|
||||
{
|
||||
|
@ -20,8 +20,7 @@ Launcher::TextInputDialog::TextInputDialog(const QString& title, const QString&
|
||||
label->setText(text);
|
||||
|
||||
// Line edit
|
||||
QValidator* validator
|
||||
= new QRegularExpressionValidator(QRegularExpression("^[a-zA-Z0-9_]*$"), this); // Alpha-numeric + underscore
|
||||
QValidator* validator = new QRegularExpressionValidator(QRegularExpression("^[a-zA-Z0-9_]*$"), this);
|
||||
mLineEdit = new LineEdit(this);
|
||||
mLineEdit->setValidator(validator);
|
||||
mLineEdit->setCompleter(nullptr);
|
||||
|
@ -30,7 +30,7 @@ bool Wizard::IniSettings::readFile(QTextStream& stream)
|
||||
// Look for a square bracket, "'\\["
|
||||
// that has one or more "not nothing" in it, "([^]]+)"
|
||||
// and is closed with a square bracket, "\\]"
|
||||
QRegularExpression sectionRe(QRegularExpression::anchoredPattern("^\\[([^]]+)\\]"));
|
||||
QRegularExpression sectionRe("^\\[([^]]+)\\]$");
|
||||
|
||||
// Find any character(s) that is/are not equal sign(s), "[^=]+"
|
||||
// followed by an optional whitespace, an equal sign, and another optional whitespace, "\\s*=\\s*"
|
||||
@ -75,7 +75,7 @@ bool Wizard::IniSettings::writeFile(const QString& path, QTextStream& stream)
|
||||
// Look for a square bracket, "'\\["
|
||||
// that has one or more "not nothing" in it, "([^]]+)"
|
||||
// and is closed with a square bracket, "\\]"
|
||||
QRegularExpression sectionRe(QRegularExpression::anchoredPattern("^\\[([^]]+)\\]"));
|
||||
QRegularExpression sectionRe("^\\[([^]]+)\\]$");
|
||||
|
||||
// Find any character(s) that is/are not equal sign(s), "[^=]+"
|
||||
// followed by an optional whitespace, an equal sign, and another optional whitespace, "\\s*=\\s*"
|
||||
|
@ -47,7 +47,7 @@ QStringList Config::LauncherSettings::subKeys(const QString& key)
|
||||
bool Config::LauncherSettings::writeFile(QTextStream& stream)
|
||||
{
|
||||
QString sectionPrefix;
|
||||
QRegularExpression sectionRe(QRegularExpression::anchoredPattern("([^/]+)/(.+)$"));
|
||||
QRegularExpression sectionRe("^([^/]+)/(.+)$");
|
||||
QMultiMap<QString, QString> settings = SettingsBase::getSettings();
|
||||
|
||||
QMapIterator<QString, QString> i(settings);
|
||||
|
@ -42,7 +42,7 @@ namespace Config
|
||||
|
||||
QString sectionPrefix;
|
||||
|
||||
QRegularExpression sectionRe(QRegularExpression::anchoredPattern("^\\[([^]]+)\\]"));
|
||||
QRegularExpression sectionRe("^\\[([^]]+)\\]$");
|
||||
QRegularExpression keyRe("^([^=]+)\\s*=\\s*(.+)$");
|
||||
|
||||
while (!stream.atEnd())
|
||||
|
Loading…
x
Reference in New Issue
Block a user