forked from qt-creator/qt-creator
texteditor: simplify basetextmark architecture
ITextMark is not abstract anymore and has an icon and a priority. This means separate breakpoint and location marker classes that are only "plain" marks with icons and priorities are not needed. BaseTextMark directly inherits from ITextMark, instead of owning an ITextMark derived InternalMark. Also, there is now ITextMark::paint() to make it a bit more flexible then icon()[->paint()]
This commit is contained in:
@@ -49,8 +49,11 @@ namespace Internal {
|
||||
|
||||
BreakpointMarker::BreakpointMarker(BreakpointId id,
|
||||
const QString &fileName, int lineNumber)
|
||||
: BaseTextMark(fileName, lineNumber), m_id(id)
|
||||
: m_id(id)
|
||||
{
|
||||
setLocation(fileName, lineNumber);
|
||||
setIcon(breakHandler()->icon(m_id));
|
||||
setPriority(TextEditor::ITextMark::NormalPriority);
|
||||
//qDebug() << "CREATE MARKER " << fileName << lineNumber;
|
||||
}
|
||||
|
||||
@@ -59,16 +62,6 @@ BreakpointMarker::~BreakpointMarker()
|
||||
//qDebug() << "REMOVE MARKER ";
|
||||
}
|
||||
|
||||
QIcon BreakpointMarker::icon() const
|
||||
{
|
||||
return breakHandler()->icon(m_id);
|
||||
}
|
||||
|
||||
void BreakpointMarker::updateBlock(const QTextBlock &)
|
||||
{
|
||||
//qDebug() << "BREAKPOINT MARKER UPDATE BLOCK";
|
||||
}
|
||||
|
||||
void BreakpointMarker::removedFromEditor()
|
||||
{
|
||||
breakHandler()->removeBreakpoint(m_id);
|
||||
|
||||
Reference in New Issue
Block a user