Commit 462bda61 authored by Lorenz Haas's avatar Lorenz Haas Committed by Eike Ziller
Browse files

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: default avatarEike Ziller <eike.ziller@digia.com>
parent 0a79a50d
......@@ -432,7 +432,10 @@ void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
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()));
saveBookmarks();
}
......
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