chore (settings): fix typo peroid -> period
This commit is contained in:
parent
d8e2537d47
commit
60d5bb8378
1 changed files with 3 additions and 3 deletions
|
|
@ -119,16 +119,16 @@ QString Settings::cleanScreenName(const QString &name)
|
|||
static const auto hyphen = QStringLiteral("-");
|
||||
static const auto space = QStringLiteral(" ");
|
||||
static const auto underscore = QStringLiteral("_");
|
||||
static const auto peroid = QStringLiteral(".");
|
||||
static const auto period = QStringLiteral(".");
|
||||
static const auto nothing = QStringLiteral("");
|
||||
static const auto nameRegex = QRegularExpression(QStringLiteral("[^\\w\\-\\.]"));
|
||||
|
||||
QString cleanName = name.simplified();
|
||||
cleanName.replace(space, underscore);
|
||||
cleanName.replace(nameRegex, nothing);
|
||||
while (cleanName.startsWith(hyphen) || cleanName.startsWith(underscore) || cleanName.startsWith(peroid))
|
||||
while (cleanName.startsWith(hyphen) || cleanName.startsWith(underscore) || cleanName.startsWith(period))
|
||||
cleanName.removeFirst();
|
||||
while (cleanName.endsWith(hyphen) || cleanName.endsWith(underscore) || cleanName.endsWith(peroid))
|
||||
while (cleanName.endsWith(hyphen) || cleanName.endsWith(underscore) || cleanName.endsWith(period))
|
||||
cleanName.removeLast();
|
||||
if (cleanName.length() > 255) {
|
||||
cleanName.truncate(255);
|
||||
|
|
|
|||
Loading…
Reference in a new issue