From 918dde486954a68a222d9bb90116eee16e8c312b Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 8 Oct 2020 15:11:39 +0200 Subject: [PATCH] katedocument: port one last QRegExp to QRegularExpression This reverts 88107e4f1f28662c, since now we require Qt 5.12. Note that QRegularExpression::wildcardToRegularExpression returns a pattern anchored with \A and \z. --- src/document/katedocument.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp index 3f919933..94c7e56f 100644 --- a/src/document/katedocument.cpp +++ b/src/document/katedocument.cpp @@ -4604,12 +4604,8 @@ void KTextEditor::DocumentPrivate::readVariableLine(const QString &t, bool onlyV bool found = false; for (const QString &pattern : wildcards) { - QRegExp wildcard(pattern, Qt::CaseSensitive, QRegExp::Wildcard); - found = wildcard.exactMatch(nameOfFile); - - // Qt 5.12, no ifdef, more to test - // QRegularExpression wildcard(QLatin1Char('^') + QRegularExpression::wildcardToRegularExpression(pattern) + QLatin1Char('$')); - // found = wildcard.match(nameOfFile).hasMatch(); + QRegularExpression wildcard(QRegularExpression::wildcardToRegularExpression(pattern)); + found = wildcard.match(nameOfFile).hasMatch(); if (found) { break; -- GitLab