summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Köhne <kai.koehne@qt.io>2022-04-06 09:17:35 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-28 10:04:00 +0000
commit73d899801edb3b741fa2978ae08aba2b6930cd23 (patch)
treebf2c06a8d0685666de695f0971ec13915c4ac95a
parent257eef7e80793913a3da304eec5ef48ca56e9fd1 (diff)
qdoc: Do not split module names in different tags
This did more harm than good, e.g. for ActiveQt->active,qt QtWebView->web,view. Change-Id: Ia08bc12ef7496fccb1a5d9bbd45c285448417adb Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 255b9699f6957282200546705ad493ab16631883) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qdoc/manifestwriter.cpp22
-rw-r--r--src/qdoc/manifestwriter.h2
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>