cmake: fix missing addition of policies to documentation index

Summary:
Since cmake 3.0 cmake also supports --help-policy-list, matching the
general --help* pattern. The KDevelop cmake documentation plugin
already has an entry for "Policies", just it is not filled with any
content.
This patch extends the content indexing by also including the policy.
For cmake < 3.0 the process CMakeCommandsContents::processOutput will
catch the failing call by the exit code, and things are as before.

Reviewers: #kdevelop, apol

Reviewed By: #kdevelop, apol

Subscribers: kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D15882
parent c7922784
......@@ -30,7 +30,7 @@
#include <KLocalizedString>
static const QVector<QString> args = {
QLatin1String("--help-command"), QLatin1String("--help-variable"), QLatin1String("--help-module"), QLatin1String("--help-property"), QString(), QString()
QLatin1String("--help-command"), QLatin1String("--help-variable"), QLatin1String("--help-module"), QLatin1String("--help-property"), QLatin1String("--help-policy"), QString()
};
static QString modules [] = {
i18n("Commands"), i18n("Variables"), i18n("Modules"), i18n("Properties"), i18n("Policies")
......@@ -40,7 +40,7 @@ CMakeCommandsContents::CMakeCommandsContents(QObject* parent)
: QAbstractItemModel(parent)
, m_namesForType(CMakeDocumentation::EOType)
{
for(int i=0; i<=CMakeDocumentation::Property; i++) {
for (int i = 0; i <= CMakeDocumentation::Policy; ++i) {
const QStringList params = { args[i]+QStringLiteral("-list") };
QProcess* process = new QProcess(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment