aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-22 13:30:59 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-22 12:11:56 +0000
commit2ef2110e0e17f827273a00f32c579e133ae3b9c2 (patch)
treed11a06f56e7ed2df0a5358b8765d0901c8d2994e
parent61e0d4df7e322d096649dd8d19c173a05655aa9b (diff)
shiboken/doc generator: Search snippets with to suffix "py" first
Replace .cpp by .py and try to find the snippet. Fall back to .cpp. Task-number: PYSIDE-363 Change-Id: I82b23df9894e626c97b44dc5a841f5fa70ae1d57 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 489d498f9..3ed278871 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -521,7 +521,13 @@ QString QtXmlToSphinx::readFromLocations(const QStringList &locations, const QSt
const QString &identifier, QString *errorMessage)
{
QString result;
- const QString resolvedPath = resolveFile(locations, path);
+ QString resolvedPath;
+ if (path.endsWith(QLatin1String(".cpp"))) {
+ const QString pySnippet = path.left(path.size() - 3) + QLatin1String("py");
+ resolvedPath = resolveFile(locations, pySnippet);
+ }
+ if (resolvedPath.isEmpty())
+ resolvedPath = resolveFile(locations, path);
if (resolvedPath.isEmpty()) {
QTextStream(errorMessage) << "Could not resolve \"" << path << "\" in \""
<< locations.join(QLatin1String("\", \""));