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/codemarker.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/codemarker.cpp')
-rw-r--r-- | src/qdoc/codemarker.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qdoc/codemarker.cpp b/src/qdoc/codemarker.cpp index 000bf97f0..ab8b53039 100644 --- a/src/qdoc/codemarker.cpp +++ b/src/qdoc/codemarker.cpp @@ -66,7 +66,7 @@ CodeMarker::~CodeMarker() A code market performs no initialization by default. Marker-specific initialization is performed in subclasses. */ -void CodeMarker::initializeMarker(const Config &) // config +void CodeMarker::initializeMarker() { } @@ -82,11 +82,11 @@ void CodeMarker::terminateMarker() All the code markers in the static list are initialized here, after the qdoc configuration file has been loaded. */ -void CodeMarker::initialize(const Config &config) +void CodeMarker::initialize() { - defaultLang = config.getString(CONFIG_LANGUAGE); + defaultLang = Config::instance().getString(CONFIG_LANGUAGE); for (const auto &marker : qAsConst(markers)) - marker->initializeMarker(config); + marker->initializeMarker(); } /*! |