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

Function interpreterForUrl

plugins/executescript/scriptappconfig.cpp:34–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32using namespace KDevelop;
33
34static const QString interpreterForUrl(const QUrl& url) {
35 auto mimetype = QMimeDatabase().mimeTypeForUrl(url);
36 static QHash<QString, QString> knownMimetypes;
37 if ( knownMimetypes.isEmpty() ) {
38 knownMimetypes[QStringLiteral("text/x-python")] = QStringLiteral("python3");
39 knownMimetypes[QStringLiteral("application/x-php")] = QStringLiteral("php");
40 knownMimetypes[QStringLiteral("application/x-ruby")] = QStringLiteral("ruby");
41 knownMimetypes[QStringLiteral("application/x-shellscript")] = QStringLiteral("bash");
42 knownMimetypes[QStringLiteral("application/x-perl")] = QStringLiteral("perl -e");
43 }
44 const QString& interp = knownMimetypes.value(mimetype.name());
45 return interp;
46}
47
48QIcon ScriptAppConfigPage::icon() const
49{

Callers 3

loadFromConfigurationMethod · 0.85
canLaunchMethod · 0.85

Calls 3

isEmptyMethod · 0.45
valueMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected