summaryrefslogtreecommitdiff
path: root/src/plugins/bookmarks
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@nokia.com>2012-03-12 16:56:25 +0100
committerEike Ziller <eike.ziller@nokia.com>2012-04-05 16:47:15 +0200
commit10438d2e9d74fe5ad38f2ccbaf1fbbe8316b4061 (patch)
treeea026b58c71f3fc87704b1d973493ddd343f058b /src/plugins/bookmarks
parentf1c299a85e08c5ce16fc8dad371a11115687edf0 (diff)
downloadqt-creator-10438d2e9d74fe5ad38f2ccbaf1fbbe8316b4061.tar.gz
BaseTextMark: Support renaming files
Change-Id: I8d712f76fca5d8f5ecad70f1485228e21c00648d Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/bookmarks')
-rw-r--r--src/plugins/bookmarks/bookmark.cpp10
-rw-r--r--src/plugins/bookmarks/bookmark.h3
2 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp
index 4de678563d..45fb4bdee3 100644
--- a/src/plugins/bookmarks/bookmark.cpp
+++ b/src/plugins/bookmarks/bookmark.cpp
@@ -70,6 +70,16 @@ void Bookmark::updateBlock(const QTextBlock &block)
}
}
+void Bookmark::updateFileName(const QString &fileName)
+{
+ m_fileName = fileName;
+ QFileInfo fi(fileName);
+ m_onlyFile = fi.fileName();
+ m_path = fi.path();
+ m_manager->updateBookmark(this);
+ BaseTextMark::updateFileName(fileName);
+}
+
QString Bookmark::lineText() const
{
return m_lineText;
diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h
index 62d55f7d1b..f26a66920f 100644
--- a/src/plugins/bookmarks/bookmark.h
+++ b/src/plugins/bookmarks/bookmark.h
@@ -54,6 +54,7 @@ public:
void updateLineNumber(int lineNumber);
void updateBlock(const QTextBlock &block);
+ void updateFileName(const QString &fileName);
void removedFromEditor();
QString filePath() const;
@@ -63,7 +64,7 @@ public:
private:
BookmarkManager *m_manager;
- const QString m_fileName;
+ QString m_fileName;
QString m_onlyFile;
QString m_path;
QString m_lineText;