2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Hugues Delorme
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2011-02-28 13:40:06 +01:00
|
|
|
#include "annotationhighlighter.h"
|
|
|
|
|
#include "constants.h"
|
|
|
|
|
|
2020-06-23 16:36:59 +02:00
|
|
|
#include <QRegularExpression>
|
|
|
|
|
|
2022-09-23 14:25:49 +02:00
|
|
|
namespace Bazaar::Internal {
|
2011-02-28 13:40:06 +01:00
|
|
|
|
|
|
|
|
BazaarAnnotationHighlighter::BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers,
|
|
|
|
|
QTextDocument *document)
|
2013-08-13 12:57:31 +02:00
|
|
|
: VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
|
2012-01-26 14:18:59 +01:00
|
|
|
m_changeset(QLatin1String(Constants::ANNOTATE_CHANGESET_ID))
|
2016-02-03 17:35:54 +01:00
|
|
|
{ }
|
2011-02-28 13:40:06 +01:00
|
|
|
|
|
|
|
|
QString BazaarAnnotationHighlighter::changeNumber(const QString &block) const
|
|
|
|
|
{
|
2020-06-23 16:36:59 +02:00
|
|
|
const QRegularExpressionMatch match = m_changeset.match(block);
|
|
|
|
|
if (match.hasMatch())
|
|
|
|
|
return match.captured(1);
|
2011-02-28 13:40:06 +01:00
|
|
|
return QString();
|
|
|
|
|
}
|
2022-09-23 14:25:49 +02:00
|
|
|
|
|
|
|
|
} // Bazaar::Internal
|