diff options
author | Topi Reinio <topi.reinio@qt.io> | 2020-01-03 23:10:47 +0100 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2020-01-13 10:30:34 +0100 |
commit | ccdbf30b6ac9180ead6fc22c858b6fac112d493c (patch) | |
tree | 684348bac8eae2acffe5c78545a608bbee9c62a9 /src/qdoc/clangcodeparser.cpp | |
parent | ade15563a6c7613b58201e6e05e3f67fde3f6056 (diff) | |
download | qttools-ccdbf30b6ac9180ead6fc22c858b6fac112d493c.tar.gz |
qdoc: Make Config a singleton
There is no need to pass a pointer to Config throughout
the API; the only instance of it is created in main()
so we can turn it into a singleton.
Having access to Config without API changes makes
implementation of configurable features easier.
Change-Id: Ida47e067865082dfe036a7a97f7f1ffc736db346
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r-- | src/qdoc/clangcodeparser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 5e04c344e..7d10ae089 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -1045,8 +1045,9 @@ ClangCodeParser::~ClangCodeParser() \a config. Call the initializeParser() in the base class. Get the defines list from the qdocconf database. */ -void ClangCodeParser::initializeParser(const Config &config) +void ClangCodeParser::initializeParser() { + Config &config = Config::instance(); printParsingErrors_ = 1; version_ = config.getString(CONFIG_VERSION); const auto args = config.getStringList(CONFIG_INCLUDEPATHS); @@ -1069,7 +1070,7 @@ void ClangCodeParser::initializeParser(const Config &config) path = fi.canonicalFilePath().toUtf8(); return path.prepend("-I"); }); - CppCodeParser::initializeParser(config); + CppCodeParser::initializeParser(); pchFileDir_.reset(nullptr); allHeaders_.clear(); pchName_.clear(); |