summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2020-02-19 23:30:43 +0200
committerOrgad Shaneh <orgads@gmail.com>2020-02-20 10:44:24 +0000
commit2ccf5c1154c3f24ad0d82d7f7b30d3b594302287 (patch)
tree22d28eeaaa300271325a6a5c9c9ee655b2460ae2
parent57e8de1e0b84f1f837773ca7e6feff2a4457886c (diff)
Adapt to upstream changes
Change-Id: Icc1f048523381e949a7eb824e373af6d4c3ceba3 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--plugins/fossil/fossileditor.cpp40
-rw-r--r--plugins/fossil/fossileditor.h1
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<QString> FossilEditorWidget::annotationChanges() const
-{
-
- const QString txt = toPlainText();
- if (txt.isEmpty())
- return QSet<QString>();
-
- // extract changeset id at the beginning of each annotated line:
- // <changeid> ...:
-
- QSet<QString> 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<QString> annotationChanges() const final;
QString changeUnderCursor(const QTextCursor &cursor) const final;
QString decorateVersion(const QString &revision) const final;
QStringList annotationPreviousVersions(const QString &revision) const final;