diff options
Diffstat (limited to 'sources')
-rw-r--r-- | sources/shiboken2/ApiExtractor/docparser.cpp | 6 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/doxygenparser.cpp | 16 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/qtdocparser.cpp | 16 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/reporthandler.cpp | 1 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/reporthandler.h | 1 | ||||
-rw-r--r-- | sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 44 |
6 files changed, 43 insertions, 41 deletions
diff --git a/sources/shiboken2/ApiExtractor/docparser.cpp b/sources/shiboken2/ApiExtractor/docparser.cpp index 532956d1a..cb5d85074 100644 --- a/sources/shiboken2/ApiExtractor/docparser.cpp +++ b/sources/shiboken2/ApiExtractor/docparser.cpp @@ -65,7 +65,7 @@ QString DocParser::execXQuery(const XQueryPtr &xquery, const QString& query) con QString errorMessage; const QString result = xquery->evaluate(query, &errorMessage); if (!errorMessage.isEmpty()) - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); return result; } @@ -138,12 +138,12 @@ R"(<xsl:template match="/"> QString errorMessage; const QString result = xsl_transform(xml, xsl, &errorMessage); if (!errorMessage.isEmpty()) - qCWarning(lcShiboken, "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgXpathDocModificationError(mods, errorMessage))); if (result == xml) { const QString message = QLatin1String("Query did not result in any modifications to \"") + xml + QLatin1Char('"'); - qCWarning(lcShiboken, "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgXpathDocModificationError(mods, message))); } return result; diff --git a/sources/shiboken2/ApiExtractor/doxygenparser.cpp b/sources/shiboken2/ApiExtractor/doxygenparser.cpp index 94c9ec7e0..7c15db1ca 100644 --- a/sources/shiboken2/ApiExtractor/doxygenparser.cpp +++ b/sources/shiboken2/ApiExtractor/doxygenparser.cpp @@ -80,7 +80,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) } if (doxyFilePath.isEmpty()) { - qCWarning(lcShiboken).noquote().nospace() + qCWarning(lcShibokenDoc).noquote().nospace() << "Can't find doxygen file for class " << metaClass->name() << ", tried: " << QDir::toNativeSeparators(documentationDataDirectory()) << "/{struct|class|namespace}"<< doxyFileSuffix; @@ -90,7 +90,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) QString errorMessage; XQueryPtr xquery = XQuery::create(doxyFilePath, &errorMessage); if (xquery.isNull()) { - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); return; } @@ -99,7 +99,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) QString classDoc = getDocumentation(xquery, classQuery, metaClass->typeEntry()->docModifications()); if (classDoc.isEmpty()) - qCWarning(lcShiboken(), "%s", qPrintable(msgCannotFindDocumentation(doxyFilePath, "class", metaClass->name(), classQuery))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(doxyFilePath, "class", metaClass->name(), classQuery))); metaClass->setDocumentation(classDoc); //Functions Documentation @@ -146,7 +146,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) } QString doc = getDocumentation(xquery, query, DocModificationList()); if (doc.isEmpty()) { - qCWarning(lcShiboken(), "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(doxyFilePath, metaClass, func, query))); } func->setDocumentation(doc); @@ -163,7 +163,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) + field->name() + QLatin1String("\"]/../detaileddescription"); QString doc = getDocumentation(xquery, query, DocModificationList()); if (doc.isEmpty()) { - qCWarning(lcShiboken(), "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(doxyFilePath, metaClass, field, query))); } field->setDocumentation(doc); @@ -176,7 +176,7 @@ void DoxygenParser::fillDocumentation(AbstractMetaClass* metaClass) + meta_enum->name() + QLatin1String("\"]/.."); QString doc = getDocumentation(xquery, query, DocModificationList()); if (doc.isEmpty()) { - qCWarning(lcShiboken(), "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(doxyFilePath, metaClass, meta_enum, query))); } meta_enum->setDocumentation(doc); @@ -189,7 +189,7 @@ Documentation DoxygenParser::retrieveModuleDocumentation(const QString& name){ QString sourceFile = documentationDataDirectory() + QLatin1String("/indexpage.xml"); if (!QFile::exists(sourceFile)) { - qCWarning(lcShiboken).noquote().nospace() + qCWarning(lcShibokenDoc).noquote().nospace() << "Can't find doxygen XML file for module " << name << ", tried: " << QDir::toNativeSeparators(sourceFile); return Documentation(); @@ -198,7 +198,7 @@ Documentation DoxygenParser::retrieveModuleDocumentation(const QString& name){ QString errorMessage; XQueryPtr xquery = XQuery::create(sourceFile, &errorMessage); if (xquery.isNull()) { - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); return {}; } diff --git a/sources/shiboken2/ApiExtractor/qtdocparser.cpp b/sources/shiboken2/ApiExtractor/qtdocparser.cpp index 2e50470e4..512473131 100644 --- a/sources/shiboken2/ApiExtractor/qtdocparser.cpp +++ b/sources/shiboken2/ApiExtractor/qtdocparser.cpp @@ -225,7 +225,7 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass) if (!sourceFile.exists()) sourceFile.setFile(sourceFileRoot + QStringLiteral(".xml")); if (!sourceFile.exists()) { - qCWarning(lcShiboken).noquote().nospace() + qCWarning(lcShibokenDoc).noquote().nospace() << "Can't find qdoc file for class " << metaClass->name() << ", tried: " << QDir::toNativeSeparators(sourceFile.absoluteFilePath()); return; @@ -235,7 +235,7 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass) QString errorMessage; XQueryPtr xquery = XQuery::create(sourceFileName, &errorMessage); if (xquery.isNull()) { - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); return; } @@ -258,7 +258,7 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass) Documentation doc(getDocumentation(xquery, query, classModifs)); if (doc.isEmpty()) - qCWarning(lcShiboken(), "%s", qPrintable(msgCannotFindDocumentation(sourceFileName, "class", className, query))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(sourceFileName, "class", className, query))); metaClass->setDocumentation(doc); //Functions Documentation @@ -268,7 +268,7 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass) queryFunctionDocumentation(sourceFileName, metaClass, classQuery, func, signedModifs, xquery, &errorMessage); if (!errorMessage.isEmpty()) - qCWarning(lcShiboken(), "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); func->setDocumentation(Documentation(documentation)); } #if 0 @@ -291,7 +291,7 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass) << meta_enum->name() << "\"]/description"; doc.setValue(getDocumentation(xquery, query, DocModificationList())); if (doc.isEmpty()) { - qCWarning(lcShiboken(), "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(sourceFileName, metaClass, meta_enum, query))); } meta_enum->setDocumentation(doc); @@ -321,7 +321,7 @@ Documentation QtDocParser::retrieveModuleDocumentation(const QString& name) if (!QFile::exists(sourceFile)) sourceFile = prefix + QLatin1String("-module.webxml"); if (!QFile::exists(sourceFile)) { - qCWarning(lcShiboken).noquote().nospace() + qCWarning(lcShibokenDoc).noquote().nospace() << "Can't find qdoc file for module " << name << ", tried: " << QDir::toNativeSeparators(sourceFile); return Documentation(); @@ -330,7 +330,7 @@ Documentation QtDocParser::retrieveModuleDocumentation(const QString& name) QString errorMessage; XQueryPtr xquery = XQuery::create(sourceFile, &errorMessage); if (xquery.isNull()) { - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); return {}; } @@ -339,7 +339,7 @@ Documentation QtDocParser::retrieveModuleDocumentation(const QString& name) + moduleName + QLatin1String("\"]/description"); Documentation doc = getDocumentation(xquery, query, DocModificationList()); if (doc.isEmpty()) { - qCWarning(lcShiboken(), "%s", qPrintable(msgCannotFindDocumentation(sourceFile, "module", name, query))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotFindDocumentation(sourceFile, "module", name, query))); return doc; } diff --git a/sources/shiboken2/ApiExtractor/reporthandler.cpp b/sources/shiboken2/ApiExtractor/reporthandler.cpp index 63091cb54..139256aaa 100644 --- a/sources/shiboken2/ApiExtractor/reporthandler.cpp +++ b/sources/shiboken2/ApiExtractor/reporthandler.cpp @@ -58,6 +58,7 @@ static int m_step_warning = 0; static QElapsedTimer m_timer; Q_LOGGING_CATEGORY(lcShiboken, "qt.shiboken") +Q_LOGGING_CATEGORY(lcShibokenDoc, "qt.shiboken.doc") void ReportHandler::install() { diff --git a/sources/shiboken2/ApiExtractor/reporthandler.h b/sources/shiboken2/ApiExtractor/reporthandler.h index 073586055..c649f9bdc 100644 --- a/sources/shiboken2/ApiExtractor/reporthandler.h +++ b/sources/shiboken2/ApiExtractor/reporthandler.h @@ -33,6 +33,7 @@ #include <QString> Q_DECLARE_LOGGING_CATEGORY(lcShiboken) +Q_DECLARE_LOGGING_CATEGORY(lcShibokenDoc) class ReportHandler { diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index 40cc255f0..4fe6ecc7a 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -478,7 +478,7 @@ QString QtXmlToSphinx::transform(const QString& doc) << reader.errorString() << " at " << reader.lineNumber() << ':' << reader.columnNumber() << '\n' << doc; m_output << INDENT << message; - qCWarning(lcShiboken).noquote().nospace() << message; + qCWarning(lcShibokenDoc).noquote().nospace() << message; break; } @@ -541,7 +541,7 @@ QString QtXmlToSphinx::readFromLocations(const QStringList &locations, const QSt << locations.join(QLatin1String("\", \"")); return QString(); // null } - qCDebug(lcShiboken).noquote().nospace() << "snippet file " << path + qCDebug(lcShibokenDoc).noquote().nospace() << "snippet file " << path << " [" << identifier << ']' << " resolved to " << resolvedPath; return readFromLocation(resolvedPath, identifier, errorMessage); } @@ -783,7 +783,7 @@ void QtXmlToSphinx::handleSnippetTag(QXmlStreamReader& reader) const QString pythonCode = readFromLocations(m_generator->codeSnippetDirs(), location, identifier, &errorMessage); if (!errorMessage.isEmpty()) - qCWarning(lcShiboken, "%s", qPrintable(msgTagWarning(reader, m_context, m_lastTagName, errorMessage))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgTagWarning(reader, m_context, m_lastTagName, errorMessage))); // Fall back to C++ snippet when "path" attribute is present. // Also read fallback snippet when comparison is desired. QString fallbackCode; @@ -792,15 +792,15 @@ void QtXmlToSphinx::handleSnippetTag(QXmlStreamReader& reader) const QString fallback = reader.attributes().value(fallbackPathAttribute()).toString(); if (QFileInfo::exists(fallback)) { if (pythonCode.isEmpty()) - qCWarning(lcShiboken, "%s", qPrintable(msgFallbackWarning(reader, m_context, m_lastTagName, location, identifier, fallback))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgFallbackWarning(reader, m_context, m_lastTagName, location, identifier, fallback))); fallbackCode = readFromLocation(fallback, identifier, &errorMessage); if (!errorMessage.isEmpty()) - qCWarning(lcShiboken, "%s", qPrintable(msgTagWarning(reader, m_context, m_lastTagName, errorMessage))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgTagWarning(reader, m_context, m_lastTagName, errorMessage))); } } if (!pythonCode.isEmpty() && !fallbackCode.isEmpty() && snippetComparison()) - qCDebug(lcShiboken, "%s", qPrintable(msgSnippetComparison(location, identifier, pythonCode, fallbackCode))); + qCDebug(lcShibokenDoc, "%s", qPrintable(msgSnippetComparison(location, identifier, pythonCode, fallbackCode))); if (!consecutiveSnippet) m_output << INDENT << "::\n\n"; @@ -1120,7 +1120,7 @@ static bool copyImage(const QString &href, const QString &docDataDir, << source.errorString(); return false; } - qCDebug(lcShiboken()).noquote().nospace() << __FUNCTION__ << " href=\"" + qCDebug(lcShibokenDoc()).noquote().nospace() << __FUNCTION__ << " href=\"" << href << "\", context=\"" << context << "\", docDataDir=\"" << docDataDir << "\", outputDir=\"" << outputDir << "\", copied \"" << source.fileName() << "\"->\"" << targetFileName << '"'; @@ -1134,7 +1134,7 @@ bool QtXmlToSphinx::copyImage(const QString &href) const ::copyImage(href, m_generator->docDataDir(), m_context, m_generator->outputDirectory(), &errorMessage); if (!result) - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); return result; } @@ -1204,7 +1204,7 @@ void QtXmlToSphinx::handleUnknownTag(QXmlStreamReader& reader) { QXmlStreamReader::TokenType token = reader.tokenType(); if (token == QXmlStreamReader::StartElement) - qCDebug(lcShiboken).noquote().nospace() << "Unknown QtDoc tag: \"" << reader.name().toString() << "\"."; + qCDebug(lcShibokenDoc).noquote().nospace() << "Unknown QtDoc tag: \"" << reader.name().toString() << "\"."; } void QtXmlToSphinx::handleSuperScriptTag(QXmlStreamReader& reader) @@ -1292,7 +1292,7 @@ void QtXmlToSphinx::handleQuoteFileTag(QXmlStreamReader& reader) QString errorMessage; QString code = readFromLocation(location, QString(), &errorMessage); if (!errorMessage.isEmpty()) - qCWarning(lcShiboken(), "%s", qPrintable(msgTagWarning(reader, m_context, m_lastTagName, errorMessage))); + qCWarning(lcShibokenDoc, "%s", qPrintable(msgTagWarning(reader, m_context, m_lastTagName, errorMessage))); m_output << INDENT << "::\n\n"; Indentation indentation(INDENT); if (code.isEmpty()) @@ -1391,7 +1391,7 @@ void QtXmlToSphinx::Table::format (QTextStream& s) const return; if (!isNormalized()) { - qCDebug(lcShiboken) << "Attempt to print an unnormalized table!"; + qCDebug(lcShibokenDoc) << "Attempt to print an unnormalized table!"; return; } @@ -1614,7 +1614,7 @@ static bool extractBrief(Documentation *sourceDoc, Documentation *brief) void QtDocGenerator::generateClass(QTextStream &s, GeneratorContext &classContext) { AbstractMetaClass *metaClass = classContext.metaClass(); - qCDebug(lcShiboken).noquote().nospace() << "Generating Documentation for " << metaClass->fullName(); + qCDebug(lcShibokenDoc).noquote().nospace() << "Generating Documentation for " << metaClass->fullName(); m_packages[metaClass->package()] << fileNameForContext(classContext); @@ -2202,7 +2202,7 @@ void QtDocGenerator::writeModuleDocumentation() if (!m_extraSectionDir.isEmpty()) { QDir extraSectionDir(m_extraSectionDir); if (!extraSectionDir.exists()) - qCWarning(lcShiboken) << m_extraSectionDir << "doesn't exist"; + qCWarning(lcShibokenDoc) << m_extraSectionDir << "doesn't exist"; QStringList fileList = extraSectionDir.entryList(QStringList() << (moduleName.mid(lastIndex + 1) + QLatin1String("?*.rst")), QDir::Files); QStringList::iterator it2 = fileList.begin(); @@ -2213,7 +2213,7 @@ void QtDocGenerator::writeModuleDocumentation() if (QFile::exists(newFilePath)) QFile::remove(newFilePath); if (!QFile::copy(m_extraSectionDir + QLatin1Char('/') + origFileName, newFilePath)) { - qCDebug(lcShiboken).noquote().nospace() << "Error copying extra doc " + qCDebug(lcShibokenDoc).noquote().nospace() << "Error copying extra doc " << QDir::toNativeSeparators(m_extraSectionDir + QLatin1Char('/') + origFileName) << " to " << QDir::toNativeSeparators(newFilePath); } @@ -2269,7 +2269,7 @@ void QtDocGenerator::writeAdditionalDocumentation() { QFile additionalDocumentationFile(m_additionalDocumentationList); if (!additionalDocumentationFile.open(QIODevice::ReadOnly | QIODevice::Text)) { - qCWarning(lcShiboken, "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgCannotOpenForReading(additionalDocumentationFile))); return; } @@ -2295,7 +2295,7 @@ void QtDocGenerator::writeAdditionalDocumentation() targetDir = outDir.absolutePath(); } else { if (!outDir.exists(dir) && !outDir.mkdir(dir)) { - qCWarning(lcShiboken, "Cannot create directory %s under %s", + qCWarning(lcShibokenDoc, "Cannot create directory %s under %s", qPrintable(dir), qPrintable(QDir::toNativeSeparators(outputDirectory()))); break; @@ -2312,14 +2312,14 @@ void QtDocGenerator::writeAdditionalDocumentation() if (QtXmlToSphinx::convertToRst(this, fi.absoluteFilePath(), rstFile, context, &errorMessage)) { ++successCount; - qCDebug(lcShiboken).nospace().noquote() << __FUNCTION__ + qCDebug(lcShibokenDoc).nospace().noquote() << __FUNCTION__ << " converted " << fi.fileName() << ' ' << rstFileName; } else { - qCWarning(lcShiboken, "%s", qPrintable(errorMessage)); + qCWarning(lcShibokenDoc, "%s", qPrintable(errorMessage)); } } else { - qCWarning(lcShiboken, "%s", + qCWarning(lcShibokenDoc, "%s", qPrintable(msgNonExistentAdditionalDocFile(m_docDataDir, line))); } ++count; @@ -2327,7 +2327,7 @@ void QtDocGenerator::writeAdditionalDocumentation() } additionalDocumentationFile.close(); - qCInfo(lcShiboken, "Created %d/%d additional documentation files.", + qCInfo(lcShibokenDoc, "Created %d/%d additional documentation files.", successCount, count); } @@ -2346,7 +2346,7 @@ bool QtDocGenerator::doSetup() m_docParser = new QtDocParser; if (m_libSourceDir.isEmpty() || m_docDataDir.isEmpty()) { - qCWarning(lcShiboken) << "Documentation data dir and/or Qt source dir not informed, " + qCWarning(lcShibokenDoc) << "Documentation data dir and/or Qt source dir not informed, " "documentation will not be extracted from Qt sources."; return false; } @@ -2395,7 +2395,7 @@ bool QtDocGenerator::handleOption(const QString &key, const QString &value) return true; } if (key == QLatin1String("doc-parser")) { - qCDebug(lcShiboken).noquote().nospace() << "doc-parser: " << value; + qCDebug(lcShibokenDoc).noquote().nospace() << "doc-parser: " << value; if (value == QLatin1String("doxygen")) m_docParser = new DoxygenParser; return true; |