kinit: deal with TODO related to multiple files

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-12 04:50:20 +03:00
parent f278eea50f
commit ccb945dbce

View file

@ -330,11 +330,16 @@ bool KLauncherAdaptor::start_service_by_storage_id(const QString &serviceName,
removeTemp(temp, urls);
return false;
}
// TODO: start one service for each
if (urls.size() > 1 && !kservice->allowMultipleFiles()) {
kError() << "service does not support multiple files" << serviceName;
showError(i18n("Service does not support multiple files: %1", serviceName), window);
return false;
kWarning() << "service does not support multiple files" << serviceName;
bool result = true;
foreach (const QString &url, urls) {
if (!start_service_by_storage_id(serviceName, QStringList() << url, envs, window, temp)) {
// if one fails then it is not exactly a success
result = false;
}
}
return result;
}
// TODO: for applications which do not support URLs - download
QStringList programandargs = KRun::processDesktopExec(*kservice, urls);