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 <martin.smith@nokia.com>
This commit is contained in:
Casper van Donderen 2012-05-10 17:35:00 +02:00 committed by Qt by Nokia
parent 85c3f6a74d
commit d4672da264

View File

@ -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);