diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-06-03 02:12:21 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-06-08 22:32:12 +0200 |
commit | 308efd48b6867603e6e16ee9927ed656835a1036 (patch) | |
tree | 99584bae04c46ec04cbe187a7c9ad3feb16daec2 /src | |
parent | Remove a few more QPairs (diff) | |
download | nheko-308efd48b6867603e6e16ee9927ed656835a1036.tar.xz |
Fix one more clazy issue
Diffstat (limited to 'src')
-rw-r--r-- | src/timeline/InputBar.cpp | 4 | ||||
-rw-r--r-- | src/timeline/TimelineModel.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 6980c364..2f3b6eae 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -776,7 +776,9 @@ InputBar::getCommandAndArgs(const QString ¤tText) const if (!currentText.startsWith('/')) 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) command_end = currentText.size(); auto name = currentText.mid(1, command_end - 1); diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index f3b3ce81..6cec615b 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -1340,7 +1340,7 @@ TimelineModel::formatDateSeparator(QDate date) const QString fmt = QLocale::system().dateFormat(QLocale::LongFormat); 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); } |