Exit if the previous KAuth helper is still running.

This commit is contained in:
Andrius Štikonas 2018-07-15 01:13:54 +01:00
parent 9a8166fe65
commit ce425ee04d
2 changed files with 6 additions and 1 deletions

View File

@ -354,6 +354,11 @@ bool ExternalCommand::startHelper()
qWarning() << "Could not connect to DBus session bus";
return false;
}
QDBusInterface iface(QStringLiteral("org.kde.kpmcore.helperinterface"), QStringLiteral("/Helper"), QStringLiteral("org.kde.kpmcore.externalcommand"), QDBusConnection::systemBus());
if (iface.isValid()) {
exit(0);
}
d->m_thread = new DBusThread;
d->m_thread->start();

View File

@ -69,7 +69,7 @@ ActionReply ExternalCommandHelper::init(const QVariantMap& args)
QStringLiteral("/Application"),
QStringLiteral("org.kde.kpmcore.ping"),
QDBusConnection::systemBus());
iface.setTimeout(5000); // 5 seconds;
iface.setTimeout(2000); // 2 seconds;
auto pcall = iface.asyncCall(QStringLiteral("ping"));
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
auto exitLoop = [&] (QDBusPendingCallWatcher *watcher) {