Commit 6ad99a42 authored by Daniel Teske's avatar Daniel Teske Committed by hjk

Bookmark: Use ITextMark::lineNumber() instead of tracking linenumber

Change-Id: I476041991fbcc4a540f62d8221846375cdf52dea
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent b7062b01
......@@ -44,8 +44,7 @@ Bookmark::Bookmark(const QString& fileName, int lineNumber, BookmarkManager *man
m_fileInfo(fileName),
m_fileName(fileName),
m_onlyFile(m_fileInfo.fileName()),
m_path(m_fileInfo.path()),
m_lineNumber(lineNumber)
m_path(m_fileInfo.path())
{
setPriority(TextEditor::ITextMark::LowPriority);
setIcon(m_manager->bookmarkIcon());
......@@ -56,13 +55,11 @@ void Bookmark::removedFromEditor()
m_manager->removeBookmark(this);
}
void Bookmark::updateLineNumber(int lineNumber)
void Bookmark::updateLineNumber(int line)
{
if (lineNumber != m_lineNumber) {
m_lineNumber = lineNumber;
if (line != lineNumber())
m_manager->updateBookmark(this);
}
BaseTextMark::updateLineNumber(lineNumber);
BaseTextMark::updateLineNumber(line);
}
void Bookmark::updateBlock(const QTextBlock &block)
......
......@@ -61,8 +61,6 @@ public:
QString path() const;
QString lineText() const;
int lineNumber() const { return m_lineNumber; }
private:
BookmarkManager *m_manager;
const QFileInfo m_fileInfo;
......@@ -70,7 +68,6 @@ private:
const QString m_onlyFile;
const QString m_path;
QString m_lineText;
int m_lineNumber;
};
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment