diff --git a/src/plugins/coreplugin/helpmanager.cpp b/src/plugins/coreplugin/helpmanager.cpp index 02bd88acffdce5a3766e67e8a77aac2dda90ab40..587a094c2387029fcab4f9776dc966036fc2aa46 100644 --- a/src/plugins/coreplugin/helpmanager.cpp +++ b/src/plugins/coreplugin/helpmanager.cpp @@ -31,6 +31,7 @@ #include "icore.h" +#include <QtCore/QDateTime> #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QFileInfo> @@ -119,6 +120,18 @@ void HelpManager::registerDocumentation(const QStringList &files) qWarning() << "Error registering namespace '" << nameSpace << "' from file '" << file << "':" << m_helpEngine->error(); } + } else { + const QLatin1String key("CreationDate"); + const QString &newDate = m_helpEngine->metaData(file, key).toString(); + const QString &oldDate = m_helpEngine->metaData( + m_helpEngine->documentationFileName(nameSpace), key).toString(); + if (QDateTime::fromString(newDate, Qt::ISODate) + > QDateTime::fromString(oldDate, Qt::ISODate)) { + if (m_helpEngine->unregisterDocumentation(nameSpace)) { + docsChanged = true; + m_helpEngine->registerDocumentation(file); + } + } } } if (docsChanged) @@ -313,16 +326,11 @@ void HelpManager::setupHelpManager() void HelpManager::verifyDocumenation() { - QStringList nameSpacesToUnregister; const QStringList ®isteredDocs = m_helpEngine->registeredDocumentations(); foreach (const QString &nameSpace, registeredDocs) { - const QString &file = m_helpEngine->documentationFileName(nameSpace); - if (!QFileInfo(file).exists()) - nameSpacesToUnregister.append(nameSpace); + if (!QFileInfo(m_helpEngine->documentationFileName(nameSpace)).exists()) + m_nameSpacesToUnregister.append(nameSpace); } - - if (!nameSpacesToUnregister.isEmpty()) - unregisterDocumentation(nameSpacesToUnregister); } } // Core