From 10a50822e460c577e0cb6c0fd6d62970107d37a1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Sep 2017 15:43:22 +0200 Subject: qtdocparser: Default to suffix '.webxml' '.webxml' is the qdoc default suffix. Check for '.webxml', first, '.xml' second for compatibility. Task-number: PYSIDE-363 Change-Id: I90c6e8d407dc0afe7ef4df4d83b48ddb43d22955 Reviewed-by: Christian Tismer --- sources/shiboken2/ApiExtractor/qtdocparser.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sources/shiboken2/ApiExtractor/qtdocparser.cpp b/sources/shiboken2/ApiExtractor/qtdocparser.cpp index 00e2384f0..82403a078 100644 --- a/sources/shiboken2/ApiExtractor/qtdocparser.cpp +++ b/sources/shiboken2/ApiExtractor/qtdocparser.cpp @@ -54,22 +54,22 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass) context = context->enclosingClass(); } - QString filename = metaClass->qualifiedCppName().toLower(); - filename.replace(QLatin1String("::"), QLatin1String("-")); - QString sourceFile = documentationDataDirectory() + QLatin1Char('/') - + filename + QLatin1String(".xml"); - if (metaClass->enclosingClass()) - sourceFile.replace(QLatin1String("::"), QLatin1String("-")); - - if (!QFile::exists(sourceFile)) { + QString sourceFileRoot = documentationDataDirectory() + QLatin1Char('/') + + metaClass->qualifiedCppName().toLower(); + sourceFileRoot.replace(QLatin1String("::"), QLatin1String("-")); + + QFileInfo sourceFile(sourceFileRoot + QStringLiteral(".webxml")); + if (!sourceFile.exists()) + sourceFile.setFile(sourceFileRoot + QStringLiteral(".xml")); + if (!sourceFile.exists()) { qCWarning(lcShiboken).noquote().nospace() << "Can't find qdoc3 file for class " << metaClass->name() << ", tried: " - << QDir::toNativeSeparators(sourceFile); + << QDir::toNativeSeparators(sourceFile.absoluteFilePath()); return; } QXmlQuery xquery; - xquery.setFocus(QUrl(sourceFile)); + xquery.setFocus(QUrl::fromLocalFile(sourceFile.absoluteFilePath())); QString className = metaClass->name(); -- cgit v1.2.3