diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qdoc/manifestwriter.cpp | 22 | ||||
-rw-r--r-- | src/qdoc/manifestwriter.h | 2 |
2 files changed, 10 insertions, 14 deletions
diff --git a/src/qdoc/manifestwriter.cpp b/src/qdoc/manifestwriter.cpp index 571128c71..820942431 100644 --- a/src/qdoc/manifestwriter.cpp +++ b/src/qdoc/manifestwriter.cpp @@ -265,7 +265,7 @@ void ManifestWriter::generateManifestFile(const QString &manifest, const QString warnAboutUnusedAttributes(usedAttributes.keys(), example); writeDescription(&writer, example); - addWordsFromModuleNamesAsTags(); + addModuleNameAsTag(); writeTagsElement(&writer); const QString exampleName = example->name().mid(example->name().lastIndexOf('/') + 1); @@ -304,20 +304,16 @@ void ManifestWriter::writeTagsElement(QXmlStreamWriter *writer) \internal Add words from module name as tags - QtQuickControls -> qt,quick,controls - QtOpenGL -> qt,opengl - QtQuick3D -> qt,quick3d + QtQuickControls -> quickcontrols + QtOpenGL -> opengl + QtQuick3D -> quick3d */ -void ManifestWriter::addWordsFromModuleNamesAsTags() +void ManifestWriter::addModuleNameAsTag() { - // '?<=': positive lookbehind - QRegularExpression re("([A-Z]+[a-z0-9]*((?<=3)D|GL)?)"); - qsizetype pos = 0; - QRegularExpressionMatch match; - while ((match = re.match(m_project, pos)).hasMatch()) { - m_tags << match.captured(1).toLower(); - pos = match.capturedEnd(); - } + QString moduleName = m_project; + if (moduleName.startsWith("Qt")) + moduleName = moduleName.mid(2); + m_tags << moduleName.toLower(); } /*! diff --git a/src/qdoc/manifestwriter.h b/src/qdoc/manifestwriter.h index fc6392afd..5d17d6de9 100644 --- a/src/qdoc/manifestwriter.h +++ b/src/qdoc/manifestwriter.h @@ -62,7 +62,7 @@ private: QDocDatabase *m_qdb { nullptr }; QList<ManifestMetaFilter> m_manifestMetaContent {}; - void addWordsFromModuleNamesAsTags(); + void addModuleNameAsTag(); void includeTagsAddedWithMetaCommand(const ExampleNode *example); void writeTagsElement(QXmlStreamWriter *writer); template <typename F> |