2023-01-27 14:17:46 +01:00
|
|
|
// Copyright (c) 2018 Artur Shepilko
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2016-11-16 12:51:32 -06:00
|
|
|
|
|
|
|
|
#include "annotationhighlighter.h"
|
|
|
|
|
#include "constants.h"
|
|
|
|
|
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
|
|
|
|
|
namespace Fossil {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
FossilAnnotationHighlighter::FossilAnnotationHighlighter(const ChangeNumbers &changeNumbers,
|
|
|
|
|
QTextDocument *document) :
|
|
|
|
|
VcsBase::BaseAnnotationHighlighter(changeNumbers, document),
|
|
|
|
|
m_changesetIdPattern(Constants::CHANGESET_ID)
|
|
|
|
|
{
|
|
|
|
|
QTC_CHECK(m_changesetIdPattern.isValid());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString FossilAnnotationHighlighter::changeNumber(const QString &block) const
|
|
|
|
|
{
|
|
|
|
|
QRegularExpressionMatch changesetIdMatch = m_changesetIdPattern.match(block);
|
|
|
|
|
if (changesetIdMatch.hasMatch())
|
|
|
|
|
return changesetIdMatch.captured(1);
|
2022-10-06 19:34:47 +02:00
|
|
|
return {};
|
2016-11-16 12:51:32 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Fossil
|