From d9b5cead974d486e015872e73f918f0e68dda96e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 19 Aug 2013 11:54:26 +0200 Subject: qdoc: Make example file names unique To avoid duplicate files for examples, the files are named this way. Suppose you have an example called mandelbrot. The example is in a subdirectory named mandelbrot, and there is a \example command somewhere like this: \example mandelbrot In this case, the mandelbrot example is in the QtCore module. Then the name of the example page will be: "qtcore-mandelbrot-example" ...and the names of the example files will be: "qtcore-mandelbrot-main-cpp.html" "qtcore-mandelbrot-mandelbrot-pro.html" "qtcore-mandelbrot-mandelbrotwidget-cpp.html" "qtcore-mandelbrot-mandelbrotwidget-h.html" "qtcore-mandelbrot-renderthread-cpp.html" "qtcore-mandelbrot-renderthread-h.html" Task-number: QTBUG-32580 Change-Id: Ic4445fd65b679523d6d94a8b0c19289d049ef0b0 Reviewed-by: Martin Smith Reviewed-by: Jerome Pasion --- src/tools/qdoc/generator.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/tools/qdoc/generator.cpp') diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index f8d4910c284..5583600bf69 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -358,6 +358,11 @@ QString Generator::fileBase(const Node *node) const if (node->subType() == Node::Module) { base.append("-module"); } + if (node->isExample() || node->isExampleFile()) + base.prepend(project.toLower() + QLatin1Char('-')); + if (node->isExample()) + base.append(QLatin1String("-example")); + } // the code below is effectively equivalent to: -- cgit v1.2.3