diff options
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r-- | src/plugins/mercurial/mercurialeditor.cpp | 14 | ||||
-rw-r--r-- | src/plugins/mercurial/mercurialeditor.h | 8 |
2 files changed, 11 insertions, 11 deletions
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 <vcsbase/vcsbaseeditor.h> -#include <QRegExp> +#include <QRegularExpression> 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; }; |