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:
hjk
2011-03-21 17:15:02 +01:00
parent e73f43c759
commit a18d0572bd
12 changed files with 114 additions and 223 deletions

View File

@@ -39,6 +39,40 @@
using namespace TextEditor;
void ITextMark::paint(QPainter *painter, const QRect &rect) const
{
m_icon.paint(painter, rect, Qt::AlignCenter);
}
void ITextMark::updateLineNumber(int lineNumber)
{
Q_UNUSED(lineNumber)
}
void ITextMark::updateBlock(const QTextBlock &)
{}
void ITextMark::removedFromEditor()
{}
void ITextMark::documentClosing()
{}
void ITextMark::setIcon(const QIcon &icon)
{
m_icon = icon;
}
void ITextMark::setPriority(Priority priority)
{
m_priority = priority;
}
ITextMark::Priority ITextMark::priority() const
{
return m_priority;
}
QMap<QString, QString> ITextEditor::openedTextEditorsContents()
{
QMap<QString, QString> workingCopy;