From f5cbf879654aa297fe7c43ade21d6b317952190d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 15 Apr 2011 15:55:11 +0200 Subject: Utils: Introduce FileSystemWatcher. Remove duplicated classes ProjectExplorer::FileWatcher and QmlProjectManager::FileSystemWatcher, create Utils::FileSystemWatcher from them, merging the functionality. Also use in HelpManager/Maemo, reducing the number of QFileSystemWatcher instances (and thus, shutdown time). --- src/plugins/coreplugin/helpmanager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/plugins/coreplugin/helpmanager.cpp') diff --git a/src/plugins/coreplugin/helpmanager.cpp b/src/plugins/coreplugin/helpmanager.cpp index ae53d2d47e..7a01ce326c 100644 --- a/src/plugins/coreplugin/helpmanager.cpp +++ b/src/plugins/coreplugin/helpmanager.cpp @@ -32,13 +32,13 @@ #include "helpmanager.h" -#include "icore.h" +#include +#include #include #include #include #include -#include #include #include @@ -58,7 +58,7 @@ struct HelpManagerPrivate { bool m_needsSetup; QHelpEngineCore *m_helpEngine; - QFileSystemWatcher *m_collectionWatcher; + Utils::FileSystemWatcher *m_collectionWatcher; QStringList m_filesToRegister; QStringList m_nameSpacesToUnregister; @@ -429,8 +429,9 @@ void HelpManager::setupHelpManager() for (it = d->m_customValues.constBegin(); it != d->m_customValues.constEnd(); ++it) setCustomValue(it.key(), it.value()); - d->m_collectionWatcher = new QFileSystemWatcher(QStringList() << collectionFilePath(), - this); + d->m_collectionWatcher = new Utils::FileSystemWatcher(this); + d->m_collectionWatcher->setObjectName(QLatin1String("HelpCollectionWatcher")); + d->m_collectionWatcher->addFile(collectionFilePath(), Utils::FileSystemWatcher::WatchAllChanges); connect(d->m_collectionWatcher, SIGNAL(fileChanged(QString)), this, SLOT(collectionFileModified())); -- cgit v1.2.1