forked from qt-creator/qt-creator
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 <david.schulz@qt.io>
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user