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 <martin.smith@digia.com>
This commit is contained in:
Topi Reinio 2015-01-13 15:08:18 +01:00 committed by Topi Reiniö
parent 595ed595ea
commit 3c37066062
3 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -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<QString> &files);
void generate();

View File

@ -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])</@param>"),
"<i>\\1<sub>\\2</sub></i>");
marked.replace("<@param>", "<i>");
marked.replace("<@param>", "<i> ");
marked.replace("</@param>", "</i>");
if (summary)