kinit: check only if the MIME type is executable

to be able to run services for files that have the executable bit set but
are not actually programs

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-12 16:30:19 +03:00
parent 3dc31e41cb
commit e19f1d01f5

View file

@ -304,7 +304,7 @@ bool KLauncherAdaptor::start_service_by_storage_id(const QString &serviceName,
{
KService::Ptr kservice = KService::serviceByStorageId(serviceName);
if (!kservice) {
kError() << "invalid service path" << serviceName;
kError() << "invalid service" << serviceName;
showError(i18n("Invalid service: %1", serviceName), window);
removeTemp(temp, urls);
return false;
@ -373,7 +373,7 @@ bool KLauncherAdaptor::start_service_by_url(const QString &url, const QStringLis
return false;
}
kDebug() << "MIME type of" << url << "is" << urlmimetype;
if (KRun::isExecutableFile(realurl, urlmimetype)) {
if (KRun::isExecutable(urlmimetype)) {
kDebug() << "execuable file" << url;
KMessageBox::sorryWId(
static_cast<WId>(window),