| 32 | using namespace KDevelop; |
| 33 | |
| 34 | static 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 | |
| 48 | QIcon ScriptAppConfigPage::icon() const |
| 49 | { |
no test coverage detected