From 83fa4051d623c3c03a0e1b1cadfc63ce735c15e2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 21 Aug 2012 12:35:11 +0200 Subject: [PATCH] Continue processing the qhp file on missing attributes qhelpgenerator would bail out with an error if a keyword would contain a missing or empty attribute. This can e.g. happen on a missing \relates in the documentation. This makes the whole help generation rather fragile, as CI doesn't stop these kind of errors from making it into the code base. So rather then failing to generate the docs simply skip the one keyword that the helpgenerator can't place into a context. Change-Id: I265dc75ba9b29c868d5b9cf8a9aae5ce880374b1 Reviewed-by: Casper van Donderen --- src/assistant/help/qhelpprojectdata.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assistant/help/qhelpprojectdata.cpp b/src/assistant/help/qhelpprojectdata.cpp index 6020293..9a229b0 100644 --- a/src/assistant/help/qhelpprojectdata.cpp +++ b/src/assistant/help/qhelpprojectdata.cpp @@ -233,10 +233,10 @@ void QHelpProjectDataPrivate::readKeywords() if (name() == QLatin1String("keyword")) { if (attributes().value(QLatin1String("ref")).toString().isEmpty() || (attributes().value(QLatin1String("name")).toString().isEmpty() - && attributes().value(QLatin1String("id")).toString().isEmpty())) - raiseError(QCoreApplication::translate("QHelpProject", - "Missing attribute in keyword at line %1.") - .arg(lineNumber())); + && attributes().value(QLatin1String("id")).toString().isEmpty())) { + qWarning("Missing attribute in keyword at line %d.", (int)lineNumber()); + continue; + } filterSectionList.last() .addIndex(QHelpDataIndexItem(attributes(). value(QLatin1String("name")).toString(), -- 2.7.4