Commit cf8a6144 authored by hjk's avatar hjk

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: default avatarEike Ziller <eike.ziller@digia.com>
parent 53bfd528
......@@ -37,10 +37,10 @@
using namespace Bookmarks::Internal;
Bookmark::Bookmark(const QString& fileName, int lineNumber, BookmarkManager *manager) :
BaseTextMark(fileName, lineNumber),
TextMark(fileName, lineNumber),
m_manager(manager)
{
setPriority(TextEditor::ITextMark::NormalPriority);
setPriority(TextEditor::TextMark::NormalPriority);
setIcon(m_manager->bookmarkIcon());
}
......@@ -52,7 +52,7 @@ void Bookmark::removedFromEditor()
void Bookmark::updateLineNumber(int line)
{
if (line != lineNumber()) {
BaseTextMark::updateLineNumber(line);
TextMark::updateLineNumber(line);
m_manager->updateBookmark(this);
}
}
......@@ -60,7 +60,7 @@ void Bookmark::updateLineNumber(int line)
void Bookmark::move(int line)
{
if (line != lineNumber()) {
BaseTextMark::move(line);
TextMark::move(line);
m_manager->updateBookmark(this);
}
}
......@@ -75,7 +75,7 @@ void Bookmark::updateBlock(const QTextBlock &block)
void Bookmark::updateFileName(const QString &fileName)
{
BaseTextMark::updateFileName(fileName);
TextMark::updateFileName(fileName);
m_manager->updateBookmark(this);
}
......
......@@ -30,15 +30,14 @@
#ifndef BOOKMARK_H
#define BOOKMARK_H
#include <texteditor/itexteditor.h>
#include <texteditor/basetextmark.h>
#include <texteditor/textmark.h>
namespace Bookmarks {
namespace Internal {
class BookmarkManager;
class Bookmark : public TextEditor::BaseTextMark
class Bookmark : public TextEditor::TextMark
{
public:
Bookmark(const QString &fileName, int lineNumber, BookmarkManager *manager);
......
......@@ -429,9 +429,7 @@ void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
}
// Add a new bookmark if no bookmark existed on this line
Bookmark *bookmark = new Bookmark(fileName, editorLine, this);
bookmark->init();
addBookmark(bookmark);
addBookmark(new Bookmark(fileName, editorLine, this));
}
void BookmarkManager::updateBookmark(Bookmark *bookmark)
......@@ -769,7 +767,6 @@ void BookmarkManager::addBookmark(const QString &s)
if (!filePath.isEmpty() && !findBookmark(filePath, lineNumber)) {
Bookmark *b = new Bookmark(filePath, lineNumber, this);
b->setNote(note);
b->init();
addBookmark(b, false);
}
} else {
......
......@@ -51,7 +51,7 @@ class DeclarationAST;
namespace TextEditor {
class BaseTextEditor;
class ITextMark;
class TextMark;
} // namespace TextEditor
namespace CppTools {
......
......@@ -1468,10 +1468,8 @@ void BreakHandler::BreakpointItem::updateMarker(BreakpointModelId id)
if (marker && (file != marker->fileName() || line != marker->lineNumber()))
destroyMarker();
if (!marker && !file.isEmpty() && line > 0) {
if (!marker && !file.isEmpty() && line > 0)
marker = new BreakpointMarker(id, file, line);
marker->init();
}
}
QIcon BreakHandler::BreakpointItem::icon() const
......
......@@ -43,10 +43,10 @@ namespace Internal {
BreakpointMarker::BreakpointMarker(BreakpointModelId id,
const QString &fileName, int lineNumber)
: BaseTextMark(fileName, lineNumber), m_id(id)
: TextMark(fileName, lineNumber), m_id(id)
{
setIcon(breakHandler()->icon(m_id));
setPriority(TextEditor::ITextMark::NormalPriority);
setPriority(TextEditor::TextMark::NormalPriority);
//qDebug() << "CREATE MARKER " << fileName << lineNumber;
}
......@@ -62,7 +62,7 @@ void BreakpointMarker::removedFromEditor()
void BreakpointMarker::updateLineNumber(int lineNumber)
{
BaseTextMark::updateLineNumber(lineNumber);
TextMark::updateLineNumber(lineNumber);
breakHandler()->updateLineNumberFromMarker(m_id, lineNumber);
}
......@@ -78,7 +78,7 @@ void BreakpointMarker::clicked()
void BreakpointMarker::updateFileName(const QString &fileName)
{
BaseTextMark::updateFileName(fileName);
TextMark::updateFileName(fileName);
breakHandler()->updateFileNameFromMarker(m_id, fileName);
}
......
......@@ -32,13 +32,13 @@
#include "breakpoint.h"
#include <texteditor/basetextmark.h>
#include <texteditor/textmark.h>
namespace Debugger {
namespace Internal {
// The red blob on the left side in the cpp editor.
class BreakpointMarker : public TextEditor::BaseTextMark
class BreakpointMarker : public TextEditor::TextMark
{
public:
BreakpointMarker(BreakpointModelId id, const QString &fileName, int lineNumber);
......
......@@ -307,7 +307,7 @@ public:
DisassemblerAgent m_disassemblerAgent;
MemoryAgent m_memoryAgent;
QScopedPointer<TextEditor::BaseTextMark> m_locationMark;
QScopedPointer<TextEditor::TextMark> m_locationMark;
QTimer m_locationTimer;
bool m_isStateDebugging;
......@@ -565,10 +565,9 @@ void DebuggerEngine::gotoLocation(const Location &loc)
editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
if (loc.needsMarker()) {
d->m_locationMark.reset(new TextEditor::BaseTextMark(file, line));
d->m_locationMark.reset(new TextEditor::TextMark(file, line));
d->m_locationMark->setIcon(debuggerCore()->locationMarkIcon());
d->m_locationMark->setPriority(TextEditor::ITextMark::HighPriority);
d->m_locationMark->init();
d->m_locationMark->setPriority(TextEditor::TextMark::HighPriority);
}
//qDebug() << "MEMORY: " << d->m_memoryAgent.hasVisibleEditor();
......
......@@ -103,8 +103,8 @@ public:
QPointer<BaseTextDocument> document;
Location location;
QPointer<DebuggerEngine> engine;
ITextMark locationMark;
QList<ITextMark *> breakpointMarks;
TextMark locationMark;
QList<TextMark *> breakpointMarks;
QList<CacheEntry> cache;
QString mimeType;
bool tryMixedInitialized;
......@@ -114,14 +114,14 @@ public:
DisassemblerAgentPrivate::DisassemblerAgentPrivate()
: document(0),
locationMark(0),
locationMark(QString(), 0),
mimeType(_("text/x-qtcreator-generic-asm")),
tryMixedInitialized(false),
tryMixed(true),
resetLocationScheduled(false)
{
locationMark.setIcon(debuggerCore()->locationMarkIcon());
locationMark.setPriority(TextEditor::ITextMark::HighPriority);
locationMark.setPriority(TextEditor::TextMark::HighPriority);
}
DisassemblerAgentPrivate::~DisassemblerAgentPrivate()
......@@ -353,7 +353,7 @@ void DisassemblerAgent::updateBreakpointMarkers()
return;
const DisassemblerLines contents = d->contentsAtCurrentLocation();
foreach (TextEditor::ITextMark *marker, d->breakpointMarks)
foreach (TextEditor::TextMark *marker, d->breakpointMarks)
d->document->removeMark(marker);
qDeleteAll(d->breakpointMarks);
d->breakpointMarks.clear();
......@@ -364,9 +364,9 @@ void DisassemblerAgent::updateBreakpointMarkers()
const int lineNumber = contents.lineForAddress(address);
if (!lineNumber)
continue;
ITextMark *marker = new ITextMark(lineNumber);
TextMark *marker = new TextMark(QString(), lineNumber);
marker->setIcon(handler->icon(id));
marker->setPriority(ITextMark::NormalPriority);
marker->setPriority(TextMark::NormalPriority);
d->breakpointMarks.append(marker);
d->document->addMark(marker);
}
......
......@@ -35,6 +35,7 @@
#include "stackhandler.h"
#include <texteditor/basetexteditor.h>
#include <texteditor/textmark.h>
#include <cppeditor/cppeditorconstants.h>
......@@ -61,7 +62,7 @@ public:
public:
QPointer<TextEditor::BaseTextEditor> editor;
QPointer<DebuggerEngine> engine;
TextEditor::ITextMark *locationMark;
TextEditor::TextMark *locationMark;
QString path;
QString producer;
};
......@@ -140,9 +141,9 @@ void SourceAgent::updateLocationMarker()
d->locationMark = 0;
if (d->engine->stackHandler()->currentFrame().file == d->path) {
int lineNumber = d->engine->stackHandler()->currentFrame().line;
d->locationMark = new TextEditor::ITextMark(lineNumber);
d->locationMark = new TextEditor::TextMark(QString(), lineNumber);
d->locationMark->setIcon(debuggerCore()->locationMarkIcon());
d->locationMark->setPriority(TextEditor::ITextMark::HighPriority);
d->locationMark->setPriority(TextEditor::TextMark::HighPriority);
d->editor->baseTextDocument()->addMark(d->locationMark);
QPlainTextEdit *plainTextEdit = d->editor->editorWidget();
QTC_ASSERT(plainTextEdit, return);
......
......@@ -57,7 +57,7 @@
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/basetextmark.h>
#include <texteditor/textmark.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/typingsettings.h>
#include <texteditor/tabsettings.h>
......
......@@ -91,11 +91,11 @@ Task Task::buildConfigurationMissingTask()
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
}
void Task::addMark(TextEditor::BaseTextMark *mark)
void Task::addMark(TextEditor::TextMark *mark)
{
QTC_ASSERT(m_mark.isNull(), return);
m_mark = QSharedPointer<TextEditor::BaseTextMark>(mark);
m_mark = QSharedPointer<TextEditor::TextMark>(mark);
}
bool Task::isNull() const
......
......@@ -33,11 +33,11 @@
#include "projectexplorer_export.h"
#include <coreplugin/id.h>
#include <texteditor/basetextmark.h>
#include <texteditor/textmark.h>
#include <utils/fileutils.h>
#include <QIcon>
#include <QMetaType>
#include <QTextLayout>
namespace ProjectExplorer {
......@@ -71,7 +71,7 @@ public:
int movedLine; // contains a line number if the line was moved in the editor
Core::Id category;
QIcon icon;
void addMark(TextEditor::BaseTextMark *mark);
void addMark(TextEditor::TextMark *mark);
// Having a QList<QTextLayout::FormatRange> in Task isn't that great
// It would be cleaner to split up the text into
......@@ -84,7 +84,7 @@ public:
QList<QTextLayout::FormatRange> formats;
private:
QSharedPointer<TextEditor::BaseTextMark> m_mark;
QSharedPointer<TextEditor::TextMark> m_mark;
static unsigned int s_nextId;
};
......
......@@ -38,11 +38,11 @@ using namespace ProjectExplorer;
TaskHub *m_instance = 0;
QSet<Core::Id> TaskHub::m_registeredCategories;
class TaskMark : public TextEditor::BaseTextMark
class TaskMark : public TextEditor::TextMark
{
public:
TaskMark(unsigned int id, const QString &fileName, int lineNumber, bool visible)
: BaseTextMark(fileName, lineNumber), m_id(id)
: TextMark(fileName, lineNumber), m_id(id)
{
setVisible(visible);
}
......@@ -60,13 +60,13 @@ private:
void TaskMark::updateLineNumber(int lineNumber)
{
TaskHub::updateTaskLineNumber(m_id, lineNumber);
BaseTextMark::updateLineNumber(lineNumber);
TextMark::updateLineNumber(lineNumber);
}
void TaskMark::updateFileName(const QString &fileName)
{
TaskHub::updateTaskFileName(m_id, fileName);
BaseTextMark::updateFileName(fileName);
TextMark::updateFileName(fileName);
}
void TaskMark::removedFromEditor()
......@@ -131,13 +131,10 @@ void TaskHub::addTask(Task task)
if (task.line != -1 && !task.file.isEmpty()) {
TaskMark *mark = new TaskMark(task.taskId, task.file.toString(), task.line, !task.icon.isNull());
mark->setIcon(task.icon);
mark->setPriority(TextEditor::ITextMark::LowPriority);
mark->setPriority(TextEditor::TextMark::LowPriority);
task.addMark(mark);
emit m_instance->taskAdded(task);
mark->init();
} else {
emit m_instance->taskAdded(task);
}
emit m_instance->taskAdded(task);
}
void TaskHub::clearTasks(Core::Id categoryId)
......
......@@ -683,7 +683,7 @@ TextMarks BaseTextDocument::marks() const
return d->m_marksCache;
}
bool BaseTextDocument::addMark(ITextMark *mark)
bool BaseTextDocument::addMark(TextMark *mark)
{
if (mark->baseTextDocument())
return false;
......@@ -730,7 +730,7 @@ TextMarks BaseTextDocument::marksAt(int line) const
return TextMarks();
}
void BaseTextDocument::removeMarkFromMarksCache(ITextMark *mark)
void BaseTextDocument::removeMarkFromMarksCache(TextMark *mark)
{
auto documentLayout = qobject_cast<BaseTextDocumentLayout*>(d->m_document->documentLayout());
QTC_ASSERT(documentLayout, return);
......@@ -753,7 +753,7 @@ void BaseTextDocument::removeMarkFromMarksCache(ITextMark *mark)
documentLayout->requestExtraAreaUpdate();
} else {
double maxWidthFactor = 1.0;
foreach (const ITextMark *mark, marks()) {
foreach (const TextMark *mark, marks()) {
if (!mark->isVisible())
continue;
maxWidthFactor = qMax(mark->widthFactor(), maxWidthFactor);
......@@ -770,7 +770,7 @@ void BaseTextDocument::removeMarkFromMarksCache(ITextMark *mark)
}
}
void BaseTextDocument::removeMark(ITextMark *mark)
void BaseTextDocument::removeMark(TextMark *mark)
{
QTextBlock block = d->m_document->findBlockByNumber(mark->lineNumber() - 1);
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(block.userData())) {
......@@ -782,7 +782,7 @@ void BaseTextDocument::removeMark(ITextMark *mark)
mark->setBaseTextDocument(0);
}
void BaseTextDocument::updateMark(ITextMark *mark)
void BaseTextDocument::updateMark(TextMark *mark)
{
Q_UNUSED(mark)
auto documentLayout = qobject_cast<BaseTextDocumentLayout*>(d->m_document->documentLayout());
......@@ -790,7 +790,7 @@ void BaseTextDocument::updateMark(ITextMark *mark)
documentLayout->requestUpdate();
}
void BaseTextDocument::moveMark(ITextMark *mark, int previousLine)
void BaseTextDocument::moveMark(TextMark *mark, int previousLine)
{
QTextBlock block = d->m_document->findBlockByNumber(previousLine - 1);
if (TextBlockUserData *data = BaseTextDocumentLayout::testUserData(block)) {
......
......@@ -32,6 +32,7 @@
#include "texteditor_global.h"
#include "itexteditor.h"
#include "itexteditor.h"
#include <QList>
......@@ -50,9 +51,10 @@ class Indenter;
class StorageSettings;
class SyntaxHighlighter;
class TabSettings;
class TextMark;
class TypingSettings;
typedef QList<ITextMark *> TextMarks;
typedef QList<TextMark *> TextMarks;
class TEXTEDITOR_EXPORT BaseTextDocument : public ITextEditorDocument
{
......@@ -85,12 +87,12 @@ public:
QTextCursor unindent(const QTextCursor &cursor);
TextMarks marks() const;
bool addMark(ITextMark *mark);
bool addMark(TextMark *mark);
TextMarks marksAt(int line) const;
void removeMark(ITextMark *mark);
void updateMark(ITextMark *mark);
void moveMark(ITextMark *mark, int previousLine);
void removeMarkFromMarksCache(TextEditor::ITextMark *mark);
void removeMark(TextMark *mark);
void updateMark(TextMark *mark);
void moveMark(TextMark *mark, int previousLine);
void removeMarkFromMarksCache(TextEditor::TextMark *mark);
// IDocument implementation.
bool save(QString *errorString, const QString &fileName, bool autoSave);
......
......@@ -40,7 +40,7 @@ CodeFormatterData::~CodeFormatterData()
TextBlockUserData::~TextBlockUserData()
{
foreach (ITextMark *mrk, m_marks) {
foreach (TextMark *mrk, m_marks) {
mrk->baseTextDocument()->removeMarkFromMarksCache(mrk);
mrk->setBaseTextDocument(0);
mrk->removedFromEditor();
......@@ -376,7 +376,7 @@ void TextBlockUserData::setCodeFormatterData(CodeFormatterData *data)
m_codeFormatterData = data;
}
void TextBlockUserData::addMark(ITextMark *mark)
void TextBlockUserData::addMark(TextMark *mark)
{
int i = 0;
for ( ; i < m_marks.size(); ++i) {
......@@ -593,7 +593,7 @@ TextMarks BaseTextDocumentLayout::documentClosing()
void BaseTextDocumentLayout::documentReloaded(TextMarks marks, BaseTextDocument *baseTextDocument)
{
foreach (ITextMark *mark, marks) {
foreach (TextMark *mark, marks) {
int blockNumber = mark->lineNumber() - 1;
QTextBlock block = document()->findBlockByNumber(blockNumber);
if (block.isValid()) {
......@@ -618,7 +618,7 @@ void BaseTextDocumentLayout::updateMarksLineNumber()
int blockNumber = 0;
while (block.isValid()) {
if (const TextBlockUserData *userData = testUserData(block))
foreach (ITextMark *mrk, userData->marks())
foreach (TextMark *mrk, userData->marks())
mrk->updateLineNumber(blockNumber + 1);
block = block.next();
++blockNumber;
......@@ -628,7 +628,7 @@ void BaseTextDocumentLayout::updateMarksLineNumber()
void BaseTextDocumentLayout::updateMarksBlock(const QTextBlock &block)
{
if (const TextBlockUserData *userData = testUserData(block))
foreach (ITextMark *mrk, userData->marks())
foreach (TextMark *mrk, userData->marks())
mrk->updateBlock(block);
}
......
......@@ -33,6 +33,7 @@
#include "texteditor_global.h"
#include "basetexteditor.h"
#include "textmark.h"
#include <QTextBlockUserData>
#include <QPlainTextDocumentLayout>
......@@ -75,12 +76,12 @@ public:
~TextBlockUserData();
inline TextMarks marks() const { return m_marks; }
void addMark(ITextMark *mark);
inline bool removeMark(ITextMark *mark) { return m_marks.removeAll(mark); }
void addMark(TextMark *mark);
inline bool removeMark(TextMark *mark) { return m_marks.removeAll(mark); }
inline TextMarks documentClosing() {
TextMarks marks = m_marks;
foreach (ITextMark *mrk, m_marks)
foreach (TextMark *mrk, m_marks)
mrk->setBaseTextDocument(0);
m_marks.clear();
return marks;
......
......@@ -3933,7 +3933,7 @@ void BaseTextEditorWidget::extraAreaPaintEvent(QPaintEvent *e)
}
TextMarks::const_iterator end = marks.constEnd();
for ( ; it != end; ++it) {
ITextMark *mark = *it;
TextMark *mark = *it;
if (!mark->isVisible())
continue;
const int height = fmLineSpacing - 1;
......@@ -4605,7 +4605,7 @@ void BaseTextEditorWidget::extraAreaMouseEvent(QMouseEvent *e)
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(block.userData())) {
TextMarks marks = data->marks();
for (int i = marks.size(); --i >= 0; ) {
ITextMark *mark = marks.at(i);
TextMark *mark = marks.at(i);
if (mark->isDraggable()) {
d->m_markDragStart = e->pos();
break;
......@@ -4653,7 +4653,7 @@ void BaseTextEditorWidget::extraAreaMouseEvent(QMouseEvent *e)
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(block.userData())) {
TextMarks marks = data->marks();
for (int i = marks.size(); --i >= 0; ) {
ITextMark *mark = marks.at(i);
TextMark *mark = marks.at(i);
if (sameLine) {
if (mark->isClickable()) {
mark->clicked();
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef BASETEXTMARK_H
#define BASETEXTMARK_H
#include "texteditor_global.h"
#include "itextmark.h"
namespace TextEditor {
namespace Internal { class BaseTextMarkRegistry; }
class TEXTEDITOR_EXPORT BaseTextMark : public TextEditor::ITextMark
{
friend class Internal::BaseTextMarkRegistry;
public:
BaseTextMark(const QString &fileName, int lineNumber);
void init();
virtual ~BaseTextMark();
/// called if the filename of the document changed
virtual void updateFileName(const QString &fileName);
// access to internal data
QString fileName() const { return m_fileName; }
private:
QString m_fileName;
};
} // namespace TextEditor
#endif // BASETEXTMARK_H
......@@ -32,17 +32,13 @@
#include "texteditor_global.h"
#include "itextmark.h"
#include <coreplugin/textdocument.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <QMap>
#include <QIcon>
QT_BEGIN_NAMESPACE
class QIcon;
class QMenu;
class QPainter;
class QPoint;
......
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "itextmark.h"
#include "basetextdocument.h"
using namespace TextEditor;
ITextMark::~ITextMark()
{
if (m_baseTextDocument)
m_baseTextDocument->removeMark(this);
m_baseTextDocument = 0;
}
int ITextMark::lineNumber() const
{
return m_lineNumber;
}
void ITextMark::paint(QPainter *painter, const QRect &rect) const
{
m_icon.paint(painter, rect, Qt::AlignCenter);
}
void ITextMark::updateLineNumber(int lineNumber)
{
m_lineNumber = lineNumber;
}
void ITextMark::move(int line)
{
if (line == m_lineNumber)
return;
const int previousLine = m_lineNumber;
m_lineNumber = line;
if (m_baseTextDocument)
m_baseTextDocument->moveMark(this, previousLine);
}
void ITextMark::updateBlock(const QTextBlock &)
{}
void ITextMark::removedFromEditor()
{}
void ITextMark::setIcon(const QIcon &icon)
{
m_icon = icon;
}
void ITextMark::updateMarker()
{
if (m_baseTextDocument)
m_baseTextDocument->updateMark(this);
}
void ITextMark::setPriority(Priority priority)
{
m_priority = priority;