|
28 | 28 |
|
29 | 29 | Documentation QtDocParser::retrieveModuleDocumentation()
|
30 | 30 | {
|
31 |
| - // TODO: This method of acquiring the module name supposes that the target language uses |
32 |
| - // dots as module separators in package names. Improve this. |
33 |
| - QString moduleName = QString(packageName()).remove(0, packageName().lastIndexOf('.') + 1); |
34 |
| - QString sourceFile = documentationDataDirectory() + '/' + moduleName.toLower() + ".xml"; |
35 |
| - |
36 |
| - if (!QFile::exists(sourceFile)) { |
37 |
| - ReportHandler::warning("Can't find qdoc3 file for module " |
38 |
| - + packageName() + ", tried: " |
39 |
| - + sourceFile); |
40 |
| - return Documentation(); |
41 |
| - } |
42 |
| - |
43 |
| - QXmlQuery xquery; |
44 |
| - xquery.setFocus(QUrl(sourceFile)); |
45 |
| - |
46 |
| - // Module documentation |
47 |
| - QString query = "/WebXML/document/page[@name=\"" + moduleName + "\"]/description"; |
48 |
| - return Documentation(getDocumentation(xquery, query, DocModificationList())); |
| 31 | + return retrieveModuleDocumentation(packageName()); |
49 | 32 | }
|
50 | 33 |
|
51 | 34 | void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass)
|
@@ -164,3 +147,25 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass)
|
164 | 147 | meta_enum->setDocumentation(doc);
|
165 | 148 | }
|
166 | 149 | }
|
| 150 | + |
| 151 | +Documentation QtDocParser::retrieveModuleDocumentation(const QString& name) |
| 152 | +{ |
| 153 | + // TODO: This method of acquiring the module name supposes that the target language uses |
| 154 | + // dots as module separators in package names. Improve this. |
| 155 | + QString moduleName = QString(name).remove(0, name.lastIndexOf('.') + 1); |
| 156 | + QString sourceFile = documentationDataDirectory() + '/' + moduleName.toLower() + ".xml"; |
| 157 | + |
| 158 | + if (!QFile::exists(sourceFile)) { |
| 159 | + ReportHandler::warning("Can't find qdoc3 file for module " |
| 160 | + + name + ", tried: " |
| 161 | + + sourceFile); |
| 162 | + return Documentation(); |
| 163 | + } |
| 164 | + |
| 165 | + QXmlQuery xquery; |
| 166 | + xquery.setFocus(QUrl(sourceFile)); |
| 167 | + |
| 168 | + // Module documentation |
| 169 | + QString query = "/WebXML/document/page[@name=\"" + moduleName + "\"]/description"; |
| 170 | + return Documentation(getDocumentation(xquery, query, DocModificationList())); |
| 171 | +} |
0 commit comments