From a35d56ca2eab3763e98e58f3ef739785b7bcd294 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 2 Aug 2022 15:56:31 +0200 Subject: [PATCH] Core: remove suspended entry from file path cache ... when cleaning up suspended documents on session switch. Fixes: QTCREATORBUG-28021 Change-Id: I6ef9fda96162d56758f176381b1eabe47eb8770f Reviewed-by: Jarek Kobus Reviewed-by: --- src/plugins/coreplugin/editormanager/documentmodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 20712a9d79d..f3ff09161cb 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -485,10 +485,15 @@ void DocumentModelPrivate::removeAllSuspendedEntries(PinnedFileRemovalPolicy pin if (pinnedFileRemovalPolicy == DoNotRemovePinnedFiles && entry->pinned) continue; + const FilePath fixedPath = DocumentManager::filePathKey(entry->fileName(), + DocumentManager::ResolveLinks); int row = i + 1/**/; d->beginRemoveRows(QModelIndex(), row, row); delete d->m_entries.takeAt(i); d->endRemoveRows(); + + if (!fixedPath.isEmpty()) + d->m_entryByFixedPath.remove(fixedPath); } QSet displayNames; for (DocumentModel::Entry *entry : qAsConst(d->m_entries)) {