diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index f605f33a44c..74b4b650b25 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -243,9 +243,8 @@ static void addFileInfo(const QString &fileName, IDocument *document, bool isLin watcher = d->linkWatcher(); else watcher = d->fileWatcher(); - if (watcher->files().contains(fileName)) - watcher->removePath(fileName); - watcher->addPath(fileName); + if (!watcher->files().contains(fileName)) + watcher->addPath(fileName); d->m_states[fileName].lastUpdatedState.insert(document, state); }