diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-04-15 15:55:11 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-04-15 15:55:11 +0200 |
commit | f5cbf879654aa297fe7c43ade21d6b317952190d (patch) | |
tree | 0bcf6dd91a365f43d9e9db056a0dbb2dfcb73c7f /src/plugins/coreplugin/helpmanager.cpp | |
parent | 72ae03ba808157f48b769cd04a9aa7ed48342be3 (diff) | |
download | qt-creator-f5cbf879654aa297fe7c43ade21d6b317952190d.tar.gz |
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).
Diffstat (limited to 'src/plugins/coreplugin/helpmanager.cpp')
-rw-r--r-- | src/plugins/coreplugin/helpmanager.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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 <coreplugin/icore.h> +#include <utils/filesystemwatcher.h> #include <QtCore/QDateTime> #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QFileInfo> -#include <QtCore/QFileSystemWatcher> #include <QtCore/QStringList> #include <QtHelp/QHelpEngineCore> @@ -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())); |