aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-09-13 15:43:22 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-09-15 08:34:54 +0000
commit10a50822e460c577e0cb6c0fd6d62970107d37a1 (patch)
treec01804c170478adf613159ba0172d799561dfda1
parente4e1027d382eef3552ebb4c6ec6bc94ecb4068c0 (diff)
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 <tismer@stackless.com>
-rw-r--r--sources/shiboken2/ApiExtractor/qtdocparser.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/shiboken2/ApiExtractor/qtdocparser.cpp b/sources/shiboken2/ApiExtractor/qtdocparser.cpp
index 00e2384f..82403a07 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();