summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qdoc/config.cpp18
-rw-r--r--src/qdoc/config.h1
-rw-r--r--src/qdoc/main.cpp8
3 files changed, 15 insertions, 12 deletions
diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp
index 0d3a5e945..e41810f7b 100644
--- a/src/qdoc/config.cpp
+++ b/src/qdoc/config.cpp
@@ -309,16 +309,20 @@ void Config::load(const QString &fileName)
}
/*!
- Joins all the strings in \a values into a single string with the
- individual \a values separated by ' '. Then it inserts the result
- into the string list map with \a var as the key.
-
- It also inserts the \a values string list into a separate map,
- also with \a var as the key.
+ Sets the \a values of a configuration variable \a var from a string list.
*/
void Config::setStringList(const QString &var, const QStringList &values)
{
- configVars_.insert(var,ConfigVar(var, values, QDir::currentPath()));
+ configVars_.replace(var, ConfigVar(var, values, QDir::currentPath()));
+}
+
+/*!
+ Adds the \a values from a string list to the configuration variable \a var.
+ Existing value(s) are kept.
+*/
+void Config::insertStringList(const QString &var, const QStringList &values)
+{
+ configVars_.insert(var, ConfigVar(var, values, QDir::currentPath()));
}
/*!
diff --git a/src/qdoc/config.h b/src/qdoc/config.h
index e01e1fa6c..06c1253b1 100644
--- a/src/qdoc/config.h
+++ b/src/qdoc/config.h
@@ -81,6 +81,7 @@ public:
void load(const QString &fileName);
void setStringList(const QString &var, const QStringList &values);
+ void insertStringList(const QString &var, const QStringList &values);
void setOptions(const QDocCommandLineParser &parser);
const QString &programName() const { return prog; }
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp
index 39ad0c9a2..4f4dcf5c4 100644
--- a/src/qdoc/main.cpp
+++ b/src/qdoc/main.cpp
@@ -234,12 +234,10 @@ static void processQdocconfFile(const QString &fileName, Config &config)
exit(1);
}
/*
- Add the defines to the configuration variables.
+ Add the defines and includepaths to their respective configuration variables.
*/
- QStringList defs = qdocGlobals.defines() + config.getStringList(CONFIG_DEFINES);
- config.setStringList(CONFIG_DEFINES,defs);
- QStringList incs = qdocGlobals.includesPaths() + config.getStringList(CONFIG_INCLUDEPATHS);
- config.setStringList(CONFIG_INCLUDEPATHS, incs);
+ config.insertStringList(CONFIG_DEFINES, qdocGlobals.defines());
+ config.insertStringList(CONFIG_INCLUDEPATHS, qdocGlobals.includesPaths());
Location::terminate();
qdocGlobals.setCurrentDir(QFileInfo(fileName).path());