forked from qt-creator/qt-creator
Bookmarks: Fix loose bookmarks while loading file
The problem was, that while loading saved bookmarks, updateBookmark() was called which automatically called saveBookmarks() even if the pointer of the new bookmark was not put into m_bookmarksList. Thus the bookmark was deleted. Task-number: QTCREATORBUG-9116 Change-Id: I9cbdfc854e2bfa0dc448d96233ca76ee62417fe2 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -432,7 +432,10 @@ void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
|
|||||||
|
|
||||||
void BookmarkManager::updateBookmark(Bookmark *bookmark)
|
void BookmarkManager::updateBookmark(Bookmark *bookmark)
|
||||||
{
|
{
|
||||||
int idx = m_bookmarksList.indexOf(bookmark);
|
const int idx = m_bookmarksList.indexOf(bookmark);
|
||||||
|
if (idx == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, 2, QModelIndex()));
|
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, 2, QModelIndex()));
|
||||||
saveBookmarks();
|
saveBookmarks();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user