forked from qt-creator/qt-creator
Axivion: Use TextEditor namespace
Change-Id: I898f2fb400c2aeba6319b1f350e7a1d8d2dfa15c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -48,6 +48,7 @@ constexpr char AxivionTextMarkId[] = "AxivionTextMark";
|
|||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace Tasking;
|
using namespace Tasking;
|
||||||
|
using namespace TextEditor;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Axivion::Internal {
|
namespace Axivion::Internal {
|
||||||
@@ -153,17 +154,17 @@ public:
|
|||||||
|
|
||||||
static AxivionPluginPrivate *dd = nullptr;
|
static AxivionPluginPrivate *dd = nullptr;
|
||||||
|
|
||||||
class AxivionTextMark : public TextEditor::TextMark
|
class AxivionTextMark : public TextMark
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AxivionTextMark(const FilePath &filePath, const ShortIssue &issue)
|
AxivionTextMark(const FilePath &filePath, const ShortIssue &issue)
|
||||||
: TextEditor::TextMark(filePath, issue.lineNumber, {Tr::tr("Axivion"), AxivionTextMarkId})
|
: TextMark(filePath, issue.lineNumber, {Tr::tr("Axivion"), AxivionTextMarkId})
|
||||||
{
|
{
|
||||||
const QString markText = issue.entity.isEmpty() ? issue.message
|
const QString markText = issue.entity.isEmpty() ? issue.message
|
||||||
: issue.entity + ": " + issue.message;
|
: issue.entity + ": " + issue.message;
|
||||||
setToolTip(issue.errorNumber + " " + markText);
|
setToolTip(issue.errorNumber + " " + markText);
|
||||||
setIcon(iconForIssue("SV")); // FIXME adapt to the issue
|
setIcon(iconForIssue("SV")); // FIXME adapt to the issue
|
||||||
setPriority(TextEditor::TextMark::NormalPriority);
|
setPriority(TextMark::NormalPriority);
|
||||||
setLineAnnotation(markText);
|
setLineAnnotation(markText);
|
||||||
setActionsProvider([id = issue.id] {
|
setActionsProvider([id = issue.id] {
|
||||||
auto action = new QAction;
|
auto action = new QAction;
|
||||||
@@ -635,7 +636,7 @@ void AxivionPluginPrivate::onDocumentOpened(IDocument *doc)
|
|||||||
|
|
||||||
void AxivionPluginPrivate::onDocumentClosed(IDocument *doc)
|
void AxivionPluginPrivate::onDocumentClosed(IDocument *doc)
|
||||||
{
|
{
|
||||||
const auto document = qobject_cast<TextEditor::TextDocument *>(doc);
|
const auto document = qobject_cast<TextDocument *>(doc);
|
||||||
if (!document)
|
if (!document)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -643,7 +644,7 @@ void AxivionPluginPrivate::onDocumentClosed(IDocument *doc)
|
|||||||
if (it != m_docMarksTrees.end())
|
if (it != m_docMarksTrees.end())
|
||||||
m_docMarksTrees.erase(it);
|
m_docMarksTrees.erase(it);
|
||||||
|
|
||||||
const TextEditor::TextMarks marks = document->marks();
|
const TextMarks marks = document->marks();
|
||||||
for (auto m : marks) {
|
for (auto m : marks) {
|
||||||
if (m->category().id == AxivionTextMarkId)
|
if (m->category().id == AxivionTextMarkId)
|
||||||
delete m;
|
delete m;
|
||||||
|
|||||||
Reference in New Issue
Block a user