summaryrefslogtreecommitdiffstats
path: root/plugins/fossil/fossileditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/fossil/fossileditor.cpp')
-rw-r--r--plugins/fossil/fossileditor.cpp40
1 files changed, 4 insertions, 36 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;