refactor: Settings make the name checking regex static in the method
This commit is contained in:
committed by
Chris Rizzitello
parent
4df7c54afb
commit
204a6cca8a
@ -155,7 +155,8 @@ QVariant Settings::defaultValue(const QString &key)
|
||||
// The localhost name can contain spaces and non word characters
|
||||
QString name = QSysInfo::machineHostName().simplified();
|
||||
name.replace(QLatin1String(" "), QStringLiteral("_"));
|
||||
name.replace(QRegularExpression(QLatin1String("\\W")), QLatin1String(""));
|
||||
static const auto nameRegex = QRegularExpression(QLatin1String("\\W"));
|
||||
name.replace(nameRegex, QLatin1String(""));
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user