diff options
author | Eike Ziller <[email protected]> | 2025-09-30 09:38:50 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2025-09-30 08:58:44 +0000 |
commit | 80b9c4495a487723fb352dc748dfb43c7ec9ca12 (patch) | |
tree | 46804e2d2dbb636ff0b0986db60c4db7f15748e2 | |
parent | 37545e6d0060d644edf75995201cfb49f2126855 (diff) |
DocumentManager: Fix re-watching after removalv18.0.0-beta2
Amends b4250871ecbf8a2704377a2c26040253bd04efcb which failed to remove
local watches when the file was removed, which afterwards leads to the
file not be rewatched when it is readded.
Change-Id: I08e103e038a699dc743bced64f28c619b74cc44e
Reviewed-by: Christian Stenger <[email protected]>
-rw-r--r-- | src/plugins/coreplugin/documentmanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index f9ef5a3ccb8..f1a65df52ef 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -144,7 +144,10 @@ public: }); } - FilePaths files() const { return watchers.keys(); } + bool contains(const FilePath &filePath) const + { + return watchers.contains(filePath) || m_localWatcher.files().contains(filePath.path()); + } bool addPath(const FilePath &path) { @@ -424,7 +427,7 @@ static void removeFileInfo(IDocument *document) d->m_states[filePath].lastUpdatedState.remove(document); if (d->m_states.value(filePath).lastUpdatedState.isEmpty()) { const FilePath &watchedFilePath = d->m_states.value(filePath).watchedFilePath; - if (d->m_fileWatcher.files().contains(watchedFilePath)) { + if (d->m_fileWatcher.contains(watchedFilePath)) { qCDebug(log) << "removing watch for" << watchedFilePath; d->m_fileWatcher.removePath(watchedFilePath); } |