ClangTools: remove already existing temporary files

If we already have a temporary saved file for a modified document in the
VFSO remove the old one.

Change-Id: I748cd05a45dc74e5d84faa48a574983a628b050f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-11-23 10:53:05 +01:00
parent 6b62a99a8a
commit a8ceeaf7df

View File

@@ -61,6 +61,8 @@ void VirtualFileSystemOverlay::update()
documentRoots[doc->filePath().absolutePath()] << doc;
AutoSavedPath saved = m_saved.take(document);
if (saved.revision != document->document()->revision()) {
if (saved.path.exists())
Utils::FileUtils::removeRecursively(saved.path);
saved.revision = document->document()->revision();
QString error;
saved.path = Utils::FilePath::fromString(m_root.path())