mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +00:00
Reduce runner service start to a single attempt
This commit is contained in:
parent
c7110f62a2
commit
8a9e5a80b4
1 changed files with 0 additions and 27 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue