From b51b3e63a6754697bedea2097f02460fe9f475d0 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 3 Sep 2013 15:57:49 +0200 Subject: Doc: Fixed QDoc's HTML generator to avoid creating blank pages. -The qdb->findModule() call creates a module node even if the module name is empty. This creates the extra module.html pages in some doc projects. -The fix is to create a condition for calling findModule() Task-number: QTBUG-32990 Change-Id: I6c1d1c53f3814ea483df2cd05b8d39dc14b0fb7b Reviewed-by: Martin Smith --- src/tools/qdoc/htmlgenerator.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/tools/qdoc/htmlgenerator.cpp') diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index f17e3adde86..2caa2f83325 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1935,15 +1935,16 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker) } //add the QT variable to the map - DocNode * moduleNode = qdb_->findModule(classe->moduleName()); - if (moduleNode && !moduleNode->qtVariable().isEmpty()) { - text.clear(); - text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE) - << "QT += " + moduleNode->qtVariable() - << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE); - requisites.insert(qtVariableText, text); + if (!classe->moduleName().isEmpty()) { + DocNode * moduleNode = qdb_->findModule(classe->moduleName()); + if (moduleNode && !moduleNode->qtVariable().isEmpty()) { + text.clear(); + text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE) + << "QT += " + moduleNode->qtVariable() + << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE); + requisites.insert(qtVariableText, text); + } } - } if (!requisites.isEmpty()) { -- cgit v1.2.3