summaryrefslogtreecommitdiff
path: root/src/qdoc/qdocindexfiles.cpp
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2020-01-03 23:10:47 +0100
committerTopi Reinio <topi.reinio@qt.io>2020-01-13 10:30:34 +0100
commitccdbf30b6ac9180ead6fc22c858b6fac112d493c (patch)
tree684348bac8eae2acffe5c78545a608bbee9c62a9 /src/qdoc/qdocindexfiles.cpp
parentade15563a6c7613b58201e6e05e3f67fde3f6056 (diff)
downloadqttools-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/qdocindexfiles.cpp')
-rw-r--r--src/qdoc/qdocindexfiles.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp
index 39d7e360e..7298f7e84 100644
--- a/src/qdoc/qdocindexfiles.cpp
+++ b/src/qdoc/qdocindexfiles.cpp
@@ -1503,11 +1503,10 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter &writer, Node *node,
}
/*!
- Writes aqdoc module index in XML to a file named \afilerName.
- \a url becaomes the \c url attribute of the <INDEX> element.
- \a title becomes the \c title attribute of the <INDEX> element.
- \a g is used to get the Config object that contains the variables
- from the module's .qdocconf file.
+ Writes a qdoc module index in XML to a file named \a fileName.
+ \a url is the \c url attribute of the <INDEX> element.
+ \a title is the \c title attribute of the <INDEX> element.
+ \a g is a pointer to the current Generator in use, stored for later use.
*/
void QDocIndexFiles::generateIndex(const QString &fileName, const QString &url,
const QString &title, Generator *g)
@@ -1529,7 +1528,7 @@ void QDocIndexFiles::generateIndex(const QString &fileName, const QString &url,
writer.writeAttribute("url", url);
writer.writeAttribute("title", title);
writer.writeAttribute("version", qdb_->version());
- writer.writeAttribute("project", g->config()->getString(CONFIG_PROJECT));
+ writer.writeAttribute("project", Config::instance().getString(CONFIG_PROJECT));
root_ = qdb_->primaryTreeRoot();
if (!root_->tree()->indexTitle().isEmpty())