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:
Lorenz Haas
2013-04-13 23:42:40 +02:00
committed by Eike Ziller
parent 0a79a50d06
commit 462bda610e

View File

@@ -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();
}