aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mercurial
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2020-02-19 23:26:24 +0200
committerOrgad Shaneh <orgads@gmail.com>2020-02-21 08:28:34 +0000
commita83f0c5d74e45899f2412def152959147a12e2b1 (patch)
treea14abcccd87b0169f3f15e803ed50467ca05fcb6 /src/plugins/mercurial
parente445f7aac3600b36af6b604852583891e473fcfe (diff)
VCS: Replace QRegExp with QRegularExpression in VcsBaseEditor
Change-Id: I8e8a6649e441597e29e88506d494ec69260bebd1 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: André Hartmann <aha_1980@gmx.de>
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r--src/plugins/mercurial/mercurialeditor.cpp14
-rw-r--r--src/plugins/mercurial/mercurialeditor.h8
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;
};