MCPcopy Create free account
hub / github.com/KDE/kdevelop / descriptionForIdentifier

Method descriptionForIdentifier

plugins/cmake/cmakecommandscontents.cpp:92–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92QString CMakeCommandsContents::descriptionForIdentifier(const QString& id, CMakeDocumentation::Type t) const
93{
94 QString desc;
95 if(args[t].size() != 0) {
96 desc = CMake::executeProcess(CMakeBuilderSettings::self()->cmakeExecutable().toLocalFile(), { args[t], id.simplified() });
97 desc.remove(QLatin1String(":ref:"));
98
99 const QString rst2html = QStandardPaths::findExecutable(QStringLiteral("rst2html"));
100 if (rst2html.isEmpty()) {
101 desc = (QLatin1String("<html><body><pre><code>") + desc.toHtmlEscaped() + QLatin1String("</code></pre>")
102 + i18n("<p>For better CMake documentation rendering, install rst2html.</p>")
103 + QLatin1String("</body></html>"));
104 } else {
105 QProcess p;
106 p.start(rst2html, { QStringLiteral("--no-toc-backlinks"), QStringLiteral("--quiet") });
107 p.write(desc.toUtf8());
108 p.closeWriteChannel();
109 p.waitForFinished();
110 desc = QString::fromUtf8(p.readAllStandardOutput());
111 }
112 }
113
114 return desc;
115}
116
117
118void CMakeCommandsContents::showItemAt(const QModelIndex& idx) const

Callers 1

showItemAtMethod · 0.45

Calls 10

executeProcessFunction · 0.85
toLocalFileMethod · 0.80
cmakeExecutableMethod · 0.80
toHtmlEscapedMethod · 0.80
findExecutableFunction · 0.70
sizeMethod · 0.45
removeMethod · 0.45
isEmptyMethod · 0.45
startMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected