forked from qt-creator/qt-creator
Merge ITextMark and BaseTextMark
Turns out we don't even need two-phase initialization, by transparently postponing registration until we get a non-empty file name, either at constuction, or at file name change times. Change-Id: I3e87e47c820066e6707e946fc474ab9c1993e61f Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -44,9 +44,9 @@ using namespace Valgrind::Callgrind;
|
||||
|
||||
CallgrindTextMark::CallgrindTextMark(const QPersistentModelIndex &index,
|
||||
const QString &fileName, int lineNumber)
|
||||
: TextEditor::BaseTextMark(fileName, lineNumber), m_modelIndex(index)
|
||||
: TextEditor::TextMark(fileName, lineNumber), m_modelIndex(index)
|
||||
{
|
||||
setPriority(TextEditor::ITextMark::HighPriority);
|
||||
setPriority(TextEditor::TextMark::HighPriority);
|
||||
setWidthFactor(4.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#ifndef CALLGRINDTEXTMARK_H
|
||||
#define CALLGRINDTEXTMARK_H
|
||||
|
||||
#include <texteditor/basetextmark.h>
|
||||
#include <texteditor/textmark.h>
|
||||
|
||||
#include <QPersistentModelIndex>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Callgrind { class Function; }
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CallgrindTextMark : public TextEditor::BaseTextMark
|
||||
class CallgrindTextMark : public TextEditor::TextMark
|
||||
{
|
||||
public:
|
||||
/**
|
||||
|
||||
@@ -1014,9 +1014,7 @@ void CallgrindToolPrivate::createTextMarks()
|
||||
continue;
|
||||
locations << location;
|
||||
|
||||
CallgrindTextMark *mark = new CallgrindTextMark(index, fileName, lineNumber);
|
||||
mark->init();
|
||||
m_textMarks.append(mark);
|
||||
m_textMarks.append(new CallgrindTextMark(index, fileName, lineNumber));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user