Reduce runner service start to a single attempt

This commit is contained in:
Marco Allegretti 2026-03-23 13:08:49 +01:00
parent c7110f62a2
commit 8a9e5a80b4

View file

@ -134,18 +134,6 @@ static bool tryResolveWithRunnerManager(const QVariantMap &spec, QVariantMap &ou
org::kde::ALaKarte::Runner1 iface(kRunnerService, kRunnerPath, bus);
if (!iface.isValid()) {
if (bus.interface()->startService(kRunnerService).isValid()) {
org::kde::ALaKarte::Runner1 retryIface(kRunnerService, kRunnerPath, bus);
if (retryIface.isValid()) {
retryIface.setTimeout(2000);
QDBusPendingReply<QVariantMap> retryReply = retryIface.ResolveLaunch(spec);
retryReply.waitForFinished();
if (!retryReply.isError()) {
out = unwrapVariantMap(retryReply.value());
return true;
}
}
}
return false;
}
@ -153,21 +141,6 @@ static bool tryResolveWithRunnerManager(const QVariantMap &spec, QVariantMap &ou
QDBusPendingReply<QVariantMap> reply = iface.ResolveLaunch(spec);
reply.waitForFinished();
if (reply.isError()) {
if (reply.error().type() == QDBusError::ServiceUnknown) {
bus.interface()->startService(kRunnerService);
org::kde::ALaKarte::Runner1 retryIface(kRunnerService, kRunnerPath, bus);
if (!retryIface.isValid()) {
return false;
}
retryIface.setTimeout(2000);
QDBusPendingReply<QVariantMap> retryReply = retryIface.ResolveLaunch(spec);
retryReply.waitForFinished();
if (retryReply.isError()) {
return false;
}
out = unwrapVariantMap(retryReply.value());
return true;
}
return false;
}