From ce425ee04de9be2cc5bbcce6c6594eb5ddb72c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Sun, 15 Jul 2018 01:13:54 +0100 Subject: [PATCH] Exit if the previous KAuth helper is still running. --- src/util/externalcommand.cpp | 5 +++++ src/util/externalcommandhelper.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/externalcommand.cpp b/src/util/externalcommand.cpp index 716e43b..0f4a629 100644 --- a/src/util/externalcommand.cpp +++ b/src/util/externalcommand.cpp @@ -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(); diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index 29b3918..a1d2b87 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -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) {