From a83f0c5d74e45899f2412def152959147a12e2b1 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 19 Feb 2020 23:26:24 +0200 Subject: VCS: Replace QRegExp with QRegularExpression in VcsBaseEditor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8e8a6649e441597e29e88506d494ec69260bebd1 Reviewed-by: Samuel Gaist Reviewed-by: André Hartmann --- src/plugins/mercurial/mercurialeditor.cpp | 14 +++++++------- src/plugins/mercurial/mercurialeditor.h | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/plugins/mercurial') diff --git a/src/plugins/mercurial/mercurialeditor.cpp b/src/plugins/mercurial/mercurialeditor.cpp index 676f26ea8f..f5b6df2f1f 100644 --- a/src/plugins/mercurial/mercurialeditor.cpp +++ b/src/plugins/mercurial/mercurialeditor.cpp @@ -43,13 +43,13 @@ namespace Mercurial { namespace Internal { MercurialEditorWidget::MercurialEditorWidget(MercurialClient *client) : - exactIdentifier12(QLatin1String(Constants::CHANGEIDEXACT12)), - exactIdentifier40(QLatin1String(Constants::CHANGEIDEXACT40)), - changesetIdentifier40(QLatin1String(Constants::CHANGESETID40)), + exactIdentifier12(QRegularExpression::anchoredPattern(Constants::CHANGEIDEXACT12)), + exactIdentifier40(QRegularExpression::anchoredPattern(Constants::CHANGEIDEXACT40)), + changesetIdentifier40(Constants::CHANGESETID40), m_client(client) { - setDiffFilePattern(QRegExp(QLatin1String(Constants::DIFFIDENTIFIER))); - setLogEntryPattern(QRegExp(QLatin1String("^changeset:\\s+(\\S+)$"))); + setDiffFilePattern(Constants::DIFFIDENTIFIER); + setLogEntryPattern("^changeset:\\s+(\\S+)$"); setAnnotateRevisionTextFormat(tr("&Annotate %1")); setAnnotatePreviousRevisionTextFormat(tr("Annotate &parent revision %1")); setAnnotationEntryPattern(Constants::CHANGESETID12); @@ -61,9 +61,9 @@ QString MercurialEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) co cursor.select(QTextCursor::WordUnderCursor); if (cursor.hasSelection()) { const QString change = cursor.selectedText(); - if (exactIdentifier12.exactMatch(change)) + if (exactIdentifier12.match(change).hasMatch()) return change; - if (exactIdentifier40.exactMatch(change)) + if (exactIdentifier40.match(change).hasMatch()) return change; } return QString(); diff --git a/src/plugins/mercurial/mercurialeditor.h b/src/plugins/mercurial/mercurialeditor.h index 868f84f535..40bf68854d 100644 --- a/src/plugins/mercurial/mercurialeditor.h +++ b/src/plugins/mercurial/mercurialeditor.h @@ -27,7 +27,7 @@ #include -#include +#include namespace Mercurial { namespace Internal { @@ -47,9 +47,9 @@ private: QString decorateVersion(const QString &revision) const override; QStringList annotationPreviousVersions(const QString &revision) const override; - mutable QRegExp exactIdentifier12; - mutable QRegExp exactIdentifier40; - const QRegExp changesetIdentifier40; + const QRegularExpression exactIdentifier12; + const QRegularExpression exactIdentifier40; + const QRegularExpression changesetIdentifier40; MercurialClient *m_client; }; -- cgit v1.2.3