From 2ccf5c1154c3f24ad0d82d7f7b30d3b594302287 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 19 Feb 2020 23:30:43 +0200 Subject: Adapt to upstream changes Change-Id: Icc1f048523381e949a7eb824e373af6d4c3ceba3 Reviewed-by: hjk --- plugins/fossil/fossileditor.cpp | 40 ++++------------------------------------ plugins/fossil/fossileditor.h | 1 - 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/plugins/fossil/fossileditor.cpp b/plugins/fossil/fossileditor.cpp index 92fd935..7035f90 100644 --- a/plugins/fossil/fossileditor.cpp +++ b/plugins/fossil/fossileditor.cpp @@ -49,19 +49,13 @@ class FossilEditorWidgetPrivate { public: FossilEditorWidgetPrivate() : - m_exactChangesetId(Constants::CHANGESET_ID_EXACT), - m_firstChangesetId(QString("\n") + Constants::CHANGESET_ID + " "), - m_nextChangesetId(m_firstChangesetId) + m_exactChangesetId(Constants::CHANGESET_ID_EXACT) { QTC_ASSERT(m_exactChangesetId.isValid(), return); - QTC_ASSERT(m_firstChangesetId.isValid(), return); - QTC_ASSERT(m_nextChangesetId.isValid(), return); } const QRegularExpression m_exactChangesetId; - const QRegularExpression m_firstChangesetId; - const QRegularExpression m_nextChangesetId; }; FossilEditorWidget::FossilEditorWidget() : @@ -70,13 +64,14 @@ FossilEditorWidget::FossilEditorWidget() : setAnnotateRevisionTextFormat(tr("&Annotate %1")); setAnnotatePreviousRevisionTextFormat(tr("Annotate &Parent Revision %1")); - const QRegExp exactDiffFileIdPattern(Constants::DIFFFILE_ID_EXACT); + const QRegularExpression exactDiffFileIdPattern(Constants::DIFFFILE_ID_EXACT); QTC_ASSERT(exactDiffFileIdPattern.isValid(), return); setDiffFilePattern(exactDiffFileIdPattern); - const QRegExp logChangePattern("^.*\\[([0-9a-f]{5,40})\\]"); + const QRegularExpression logChangePattern("^.*\\[([0-9a-f]{5,40})\\]"); QTC_ASSERT(logChangePattern.isValid(), return); setLogEntryPattern(logChangePattern); + setAnnotationEntryPattern(QString("^") + Constants::CHANGESET_ID + " "); } FossilEditorWidget::~FossilEditorWidget() @@ -84,33 +79,6 @@ FossilEditorWidget::~FossilEditorWidget() delete d; } -QSet FossilEditorWidget::annotationChanges() const -{ - - const QString txt = toPlainText(); - if (txt.isEmpty()) - return QSet(); - - // extract changeset id at the beginning of each annotated line: - // ...: - - QSet changes; - - QRegularExpressionMatch firstChangesetIdMatch = d->m_firstChangesetId.match(txt); - if (firstChangesetIdMatch.hasMatch()) { - QString changeId = firstChangesetIdMatch.captured(1); - changes.insert(changeId); - - QRegularExpressionMatchIterator i = d->m_nextChangesetId.globalMatch(txt); - while (i.hasNext()) { - const QRegularExpressionMatch nextChangesetIdMatch = i.next(); - changeId = nextChangesetIdMatch.captured(1); - changes.insert(changeId); - } - } - return changes; -} - QString FossilEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const { QTextCursor cursor = cursorIn; diff --git a/plugins/fossil/fossileditor.h b/plugins/fossil/fossileditor.h index db43d41..c9612f1 100644 --- a/plugins/fossil/fossileditor.h +++ b/plugins/fossil/fossileditor.h @@ -41,7 +41,6 @@ public: ~FossilEditorWidget() final; private: - QSet annotationChanges() const final; QString changeUnderCursor(const QTextCursor &cursor) const final; QString decorateVersion(const QString &revision) const final; QStringList annotationPreviousVersions(const QString &revision) const final; -- cgit v1.2.3