diff options
author | Topi Reinio <topi.reinio@qt.io> | 2023-03-02 20:08:26 +0000 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2023-03-14 10:07:20 +0000 |
commit | 71a826b126b74795f2f0fd2f3bdca3c4abddc835 (patch) | |
tree | 322f70986da382bd319a65efed64a1e2cdfe9b58 /src/qdoc/cppcodeparser.cpp | |
parent | ea641ace22e8c2eca957470206cd20b54f7bd9a0 (diff) | |
download | qttools-71a826b126b74795f2f0fd2f3bdca3c4abddc835.tar.gz |
qdoc: Remove unnecessary Config access functions
Config class now provides Config::get(), returning a
ConfigVar reference which can be further converted
to string, list, set, int, or bool. Use get()
throughout the codebase and remove the old access
functions.
In addition, make Config::get() return a const
reference, and prevent an unnecessary contains()
check by using an iterator.
Do some drive-by cleaning of related code.
Change-Id: I2ff2203824cd4ae80c4615080948565219ad20b2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Diffstat (limited to 'src/qdoc/cppcodeparser.cpp')
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index db339537f..f8d829187 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -92,8 +92,9 @@ CppCodeParser::CppCodeParser() void CppCodeParser::initializeParser() { Config &config = Config::instance(); - QStringList exampleFilePatterns = - config.getStringList(CONFIG_EXAMPLES + Config::dot + CONFIG_FILEEXTENSIONS); + QStringList exampleFilePatterns{config.get(CONFIG_EXAMPLES + + Config::dot + + CONFIG_FILEEXTENSIONS).asStringList()}; // Used for excluding dirs and files from the list of example files const auto &excludeDirsList = config.getCanonicalPathList(CONFIG_EXCLUDEDIRS); @@ -106,15 +107,16 @@ void CppCodeParser::initializeParser() else m_exampleNameFilter = "*.cpp *.h *.js *.xq *.svg *.xml *.ui"; - QStringList exampleImagePatterns = - config.getStringList(CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS); + QStringList exampleImagePatterns{config.get(CONFIG_EXAMPLES + + Config::dot + + CONFIG_IMAGEEXTENSIONS).asStringList()}; if (!exampleImagePatterns.isEmpty()) m_exampleImageFilter = exampleImagePatterns.join(' '); else m_exampleImageFilter = "*.png"; - m_showLinkErrors = !config.getBool(CONFIG_NOLINKERRORS); + m_showLinkErrors = !config.get(CONFIG_NOLINKERRORS).asBool(); } /*! |