diff options
author | hjk <qtc-committer@nokia.com> | 2011-03-21 17:15:02 +0100 |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2011-03-21 17:15:02 +0100 |
commit | a18d0572bd8106c29f1042d6857baa00c6df4883 (patch) | |
tree | 0f22213b36d3bc9e5c7a2078208660b4dc0047ec /src/plugins/bookmarks | |
parent | e73f43c7598529afb24b72d25fe65a9bfb55dca6 (diff) | |
download | qt-creator-a18d0572bd8106c29f1042d6857baa00c6df4883.tar.gz |
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()]
Diffstat (limited to 'src/plugins/bookmarks')
-rw-r--r-- | src/plugins/bookmarks/bookmark.cpp | 9 | ||||
-rw-r--r-- | src/plugins/bookmarks/bookmark.h | 5 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp index 375c4682a7..fc08ea65b2 100644 --- a/src/plugins/bookmarks/bookmark.cpp +++ b/src/plugins/bookmarks/bookmark.cpp @@ -40,7 +40,6 @@ using namespace Bookmarks::Internal; Bookmark::Bookmark(const QString& fileName, int lineNumber, BookmarkManager *manager) : - BaseTextMark(fileName, lineNumber), m_manager(manager), m_fileInfo(fileName), m_fileName(fileName), @@ -48,11 +47,9 @@ Bookmark::Bookmark(const QString& fileName, int lineNumber, BookmarkManager *man m_path(m_fileInfo.path()), m_lineNumber(lineNumber) { -} - -QIcon Bookmark::icon() const -{ - return m_manager->bookmarkIcon(); + setLocation(fileName, lineNumber), + setPriority(TextEditor::ITextMark::LowPriority); + setIcon(m_manager->bookmarkIcon()); } void Bookmark::removedFromEditor() diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h index 41e116ad17..0f04c6b35b 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/bookmarks/bookmark.h @@ -54,19 +54,16 @@ class Bookmark : public TextEditor::BaseTextMark public: Bookmark(const QString &fileName, int lineNumber, BookmarkManager *manager); - QIcon icon() const; - void updateLineNumber(int lineNumber); void updateBlock(const QTextBlock &block); void removedFromEditor(); - TextEditor::ITextMark::Priority priority() const { return TextEditor::ITextMark::LowPriority; } QString filePath() const; QString fileName() const; QString path() const; QString lineText() const; - inline int lineNumber() const { return m_lineNumber; } + int lineNumber() const { return m_lineNumber; } private: BookmarkManager *m_manager; |