Changeset View
Changeset View
Standalone View
Standalone View
plugins/cmake/cmakecommandscontents.cpp
Show All 24 Lines | |||||
25 | #include <interfaces/idocumentation.h> | 25 | #include <interfaces/idocumentation.h> | ||
26 | #include <interfaces/idocumentationcontroller.h> | 26 | #include <interfaces/idocumentationcontroller.h> | ||
27 | #include "cmakebuilderconfig.h" | 27 | #include "cmakebuilderconfig.h" | ||
28 | #include "cmakedoc.h" | 28 | #include "cmakedoc.h" | ||
29 | #include <QProcess> | 29 | #include <QProcess> | ||
30 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
31 | 31 | | |||
32 | static const QVector<QString> args = { | 32 | static const QVector<QString> args = { | ||
33 | QLatin1String("--help-command"), QLatin1String("--help-variable"), QLatin1String("--help-module"), QLatin1String("--help-property"), QString(), QString() | 33 | QLatin1String("--help-command"), QLatin1String("--help-variable"), QLatin1String("--help-module"), QLatin1String("--help-property"), QLatin1String("--help-policy"), QString() | ||
34 | }; | 34 | }; | ||
35 | static QString modules [] = { | 35 | static QString modules [] = { | ||
36 | i18n("Commands"), i18n("Variables"), i18n("Modules"), i18n("Properties"), i18n("Policies") | 36 | i18n("Commands"), i18n("Variables"), i18n("Modules"), i18n("Properties"), i18n("Policies") | ||
37 | }; | 37 | }; | ||
38 | 38 | | |||
39 | CMakeCommandsContents::CMakeCommandsContents(QObject* parent) | 39 | CMakeCommandsContents::CMakeCommandsContents(QObject* parent) | ||
40 | : QAbstractItemModel(parent) | 40 | : QAbstractItemModel(parent) | ||
41 | , m_namesForType(CMakeDocumentation::EOType) | 41 | , m_namesForType(CMakeDocumentation::EOType) | ||
42 | { | 42 | { | ||
43 | for(int i=0; i<=CMakeDocumentation::Property; i++) { | 43 | for (int i = 0; i <= CMakeDocumentation::Policy; ++i) { | ||
44 | const QStringList params = { args[i]+QStringLiteral("-list") }; | 44 | const QStringList params = { args[i]+QStringLiteral("-list") }; | ||
45 | 45 | | |||
46 | QProcess* process = new QProcess(this); | 46 | QProcess* process = new QProcess(this); | ||
47 | process->setProperty("type", i); | 47 | process->setProperty("type", i); | ||
48 | process->setProgram(CMakeBuilderSettings::self()->cmakeExecutable().toLocalFile()); | 48 | process->setProgram(CMakeBuilderSettings::self()->cmakeExecutable().toLocalFile()); | ||
49 | process->setArguments(params); | 49 | process->setArguments(params); | ||
50 | KDevelop::ICore::self()->runtimeController()->currentRuntime()->startProcess(process); | 50 | KDevelop::ICore::self()->runtimeController()->currentRuntime()->startProcess(process); | ||
51 | 51 | | |||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |