diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index ccdbaa5f9bae4b5e256ae1a222dd27774d8c2599..367aead0f35e72a0e6510ad96ce5851ecbe36ce0 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -99,30 +99,33 @@ void HelpManager::registerDocumentation(const QStringList &fileNames) bool needsSetup = false; { QHelpEngineCore hc(m_plugin->helpEngine()->collectionFile()); - if (!hc.setupData()) + if (!hc.setupData()) { qWarning() << "Could not initialize help engine:" << hc.error(); + return; + } foreach (const QString &fileName, fileNames) { if (!QFileInfo(fileName).exists()) continue; const QString &nameSpace = QHelpEngineCore::namespaceName(fileName); - if (!nameSpace.isEmpty()) { - if (hc.registeredDocumentations().contains(nameSpace)) { - if (!QFileInfo(hc.documentationFileName(nameSpace)).exists()) { - // remove stale documentation path first - if (!hc.unregisterDocumentation(nameSpace)) { - qWarning() << "error unregistering " << fileName << hc.error(); - continue; - } - } else { - continue; - } - } - if (hc.registerDocumentation(fileName)) { - needsSetup = true; - } else { - qWarning() << "error registering" << fileName << hc.error(); + if (nameSpace.isEmpty()) + continue; + if (hc.registeredDocumentations().contains(nameSpace)) { + if (QFileInfo(hc.documentationFileName(nameSpace)).exists()) + continue; + + // remove stale documentation first + if (!hc.unregisterDocumentation(nameSpace)) { + qWarning() << "error unregistering namespace '" + << nameSpace << "' from file '" << fileName << "': " + << hc.error(); + continue; } } + if (hc.registerDocumentation(fileName)) { + needsSetup = true; + } else { + qWarning() << "error registering" << fileName << hc.error(); + } } } if (needsSetup)