From: Lars Knoll Date: Tue, 21 Aug 2012 10:35:11 +0000 (+0200) Subject: Continue processing the qhp file on missing attributes X-Git-Tag: accepted/tizen/20131212.181521~247 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83fa4051d623c3c03a0e1b1cadfc63ce735c15e2;p=platform%2Fupstream%2Fqttools.git 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 --- 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(),