mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kinit: error out when services do not support remote URLs and one is detected
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
85cf5851bd
commit
39320266cc
1 changed files with 11 additions and 0 deletions
|
@ -309,6 +309,17 @@ bool KLauncherAdaptor::start_service_by_storage_id(const QString &serviceName,
|
||||||
removeTemp(temp, urls);
|
removeTemp(temp, urls);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const QString kserviceexec = kservice->exec();
|
||||||
|
if (!kserviceexec.contains(QLatin1String("%u")) && !kserviceexec.contains(QLatin1String("%U"))) {
|
||||||
|
foreach (const QString &url, urls) {
|
||||||
|
if (!KUrl(url).isLocalFile()) {
|
||||||
|
kError() << "service does not support remote" << serviceName;
|
||||||
|
showError(i18n("Service does not support remote URLs: %1", serviceName), window);
|
||||||
|
removeTemp(temp, urls);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (urls.size() > 1 && !kservice->allowMultipleFiles()) {
|
if (urls.size() > 1 && !kservice->allowMultipleFiles()) {
|
||||||
kWarning() << "service does not support multiple files" << serviceName;
|
kWarning() << "service does not support multiple files" << serviceName;
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue