Fix one more clazy issue

This commit is contained in:
Nicolas Werner 2023-06-03 02:12:21 +02:00
parent 9e983b1584
commit 308efd48b6
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 4 additions and 2 deletions

View file

@ -776,7 +776,9 @@ InputBar::getCommandAndArgs(const QString &currentText) const
if (!currentText.startsWith('/')) if (!currentText.startsWith('/'))
return {{}, currentText}; return {{}, currentText};
int command_end = currentText.indexOf(QRegularExpression(QStringLiteral("\\s"))); static QRegularExpression spaceRegex(QStringLiteral("\\s"));
int command_end = currentText.indexOf(spaceRegex);
if (command_end == -1) if (command_end == -1)
command_end = currentText.size(); command_end = currentText.size();
auto name = currentText.mid(1, command_end - 1); auto name = currentText.mid(1, command_end - 1);

View file

@ -1340,7 +1340,7 @@ TimelineModel::formatDateSeparator(QDate date) const
QString fmt = QLocale::system().dateFormat(QLocale::LongFormat); QString fmt = QLocale::system().dateFormat(QLocale::LongFormat);
if (now.date().year() == date.year()) { if (now.date().year() == date.year()) {
QRegularExpression rx(QStringLiteral("[^a-zA-Z]*y+[^a-zA-Z]*")); static QRegularExpression rx(QStringLiteral("[^a-zA-Z]*y+[^a-zA-Z]*"));
fmt = fmt.remove(rx); fmt = fmt.remove(rx);
} }