From 3c37066062d61a430b8e7f970cccf6effab5a3ef Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 13 Jan 2015 15:08:18 +0100 Subject: qdoc: Ensure .qhp file is generated for all modules When run in single-exec mode, QDoc constructs only one instance of HelpProjectWriter, even though it generates documentation for multiple modules in one go. This change adds a reset() function for the help project writer, allowing new parameters to be passed to the existing writer instance, thus ensuring that all .qhp files are correctly generated. Task-number: QTBUG-43815 Change-Id: I1d1c9f713eb5f574a6f8e56616cf5f61bb3e8ff8 Reviewed-by: Martin Smith --- src/tools/qdoc/helpprojectwriter.cpp | 10 +++++++++- src/tools/qdoc/helpprojectwriter.h | 3 +++ src/tools/qdoc/htmlgenerator.cpp | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/helpprojectwriter.cpp b/src/tools/qdoc/helpprojectwriter.cpp index d0960e48bd..f4b866f856 100644 --- a/src/tools/qdoc/helpprojectwriter.cpp +++ b/src/tools/qdoc/helpprojectwriter.cpp @@ -49,8 +49,16 @@ QT_BEGIN_NAMESPACE HelpProjectWriter::HelpProjectWriter(const Config &config, const QString &defaultFileName, Generator* g) - : gen_(g) { + reset(config, defaultFileName, g); +} + +void HelpProjectWriter::reset(const Config &config, + const QString &defaultFileName, + Generator* g) +{ + projects.clear(); + gen_ = g; /* Get the pointer to the singleton for the qdoc database and store it locally. This replaces all the local accesses to diff --git a/src/tools/qdoc/helpprojectwriter.h b/src/tools/qdoc/helpprojectwriter.h index 2519e62c13..04aa1ce11b 100644 --- a/src/tools/qdoc/helpprojectwriter.h +++ b/src/tools/qdoc/helpprojectwriter.h @@ -83,6 +83,9 @@ public: HelpProjectWriter(const Config &config, const QString &defaultFileName, Generator* g); + void reset(const Config &config, + const QString &defaultFileName, + Generator* g); void addExtraFile(const QString &file); void addExtraFiles(const QSet &files); void generate(); diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index fddb53dff1..7cf6c3b609 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -226,7 +226,9 @@ void HtmlGenerator::initializeGenerator(const Config &config) The help file write should be allocated once and only once per qdoc execution. */ - if (helpProjectWriter == 0) + if (helpProjectWriter) + helpProjectWriter->reset(config, project.toLower() + ".qhp", this); + else helpProjectWriter = new HelpProjectWriter(config, project.toLower() + ".qhp", this); // Documentation template handling @@ -3116,7 +3118,7 @@ void HtmlGenerator::generateQmlItem(const Node *node, } marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); - marked.replace("<@param>", ""); + marked.replace("<@param>", " "); marked.replace("", ""); if (summary) -- cgit v1.2.3