From e9da512e321c6ea7795a4abc0b9d24bf4d3d2527 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 22 Apr 2010 14:58:11 +1000 Subject: Do not treat images in qml examples differently. --- tools/qdoc3/cppcodeparser.cpp | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 730f122..13678af 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -2268,44 +2268,35 @@ void CppCodeParser::instantiateIteratorMacro(const QString &container, void CppCodeParser::createExampleFileNodes(FakeNode *fake) { QString examplePath = fake->name(); + QString proFileName = examplePath + "/" + examplePath.split("/").last() + ".pro"; QString userFriendlyFilePath; - bool isQmlExample = false; - // let's check if this is a QML example - QString proFileName = examplePath + "/" + examplePath.split("/").last() + ".qmlproject"; QString fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - if (!fullPath.isEmpty()) { - isQmlExample = true; - } else { - // let's check if there is a .pro file - proFileName = examplePath + "/" + examplePath.split("/").last() + ".pro"; + if (fullPath.isEmpty()) { + QString tmp = proFileName; + proFileName = examplePath + "/" + "qbuild.pro"; userFriendlyFilePath.clear(); - fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - if (fullPath.isEmpty()) { - // let's check if there is a qbuild.pro file - QString tmp = proFileName; - proFileName = examplePath + "/" + "qbuild.pro"; + proFileName = examplePath + "/" + examplePath.split("/").last() + ".qmlproject"; userFriendlyFilePath.clear(); fullPath = Config::findFile(fake->doc().location(), exampleFiles, exampleDirs, proFileName, userFriendlyFilePath); - if (fullPath.isEmpty()) { fake->doc().location().warning( - tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName)); + tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName)); return; } } @@ -2315,14 +2306,7 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) fullPath.truncate(fullPath.lastIndexOf('/')); QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter); - - // QML examples do not put images in a "images" directory. - QString imagesPath; - if (isQmlExample) - imagesPath = fullPath; - else - imagesPath = fullPath + "/images"; - + QString imagesPath = fullPath + "/images"; QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter); if (!exampleFiles.isEmpty()) { -- cgit v0.12