From d4672da26441582b1ad9012bc2f94afc94f3d981 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 10 May 2012 17:35:00 +0200 Subject: [PATCH] QDoc: Return correct path when quoting example files. When the exampledirs qdocconf variable is . the first 2 characters of the file to quote from were being cut off, since there was a string comparison between the size of the strings with and without './' Change-Id: Iede54b5f77ec8a7530c608908f08e7eb4351f0f1 Reviewed-by: Martin Smith --- src/tools/qdoc/cppcodeparser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 3d2cc60d8b..b77d6682d1 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -2509,6 +2509,8 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake) } int sizeOfBoringPartOfName = fullPath.size() - proFileName.size(); + if (fullPath.startsWith("./")) + sizeOfBoringPartOfName = sizeOfBoringPartOfName - 2; fullPath.truncate(fullPath.lastIndexOf('/')); QStringList exampleFiles = Config::getFilesHere(fullPath,exampleNameFilter);