forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Orgad Shaneh
parent
e445f7aac3
commit
a83f0c5d74
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user