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 <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-08-02 15:56:31 +02:00
parent 98a39401db
commit a35d56ca2e

View File

@@ -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/*<no document>*/;
d->beginRemoveRows(QModelIndex(), row, row);
delete d->m_entries.takeAt(i);
d->endRemoveRows();
if (!fixedPath.isEmpty())
d->m_entryByFixedPath.remove(fixedPath);
}
QSet<QString> displayNames;
for (DocumentModel::Entry *entry : qAsConst(d->m_entries)) {