Commit 4d6e3303 authored by Eike Ziller's avatar Eike Ziller
Browse files

Fix that help bookmarks could get lost



When closing Qt Creator before the help bookmark model was set up, it
would write an empty list of bookmarks.

Task-number: QTCREATORBUG-17537
Change-Id: I638312f21dfa201a617a4eeafb7fa161726a36ff
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent a1ae4aff
......@@ -596,6 +596,8 @@ BookmarkModel* BookmarkManager::listBookmarkModel() const
void BookmarkManager::saveBookmarks()
{
if (!m_isModelSetup)
return;
QByteArray bookmarks;
QDataStream stream(&bookmarks, QIODevice::WriteOnly);
......@@ -708,6 +710,7 @@ void BookmarkManager::itemChanged(QStandardItem *item)
void BookmarkManager::setupBookmarkModels()
{
m_isModelSetup = true;
treeModel->clear();
listModel->clear();
......
......@@ -176,4 +176,5 @@ private:
BookmarkModel *treeModel;
BookmarkModel *listModel;
QStandardItem *renameItem;
bool m_isModelSetup = false;
};
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