Exit if the previous KAuth helper is still running.
This commit is contained in:
parent
9a8166fe65
commit
ce425ee04d
|
@ -354,6 +354,11 @@ bool ExternalCommand::startHelper()
|
||||||
qWarning() << "Could not connect to DBus session bus";
|
qWarning() << "Could not connect to DBus session bus";
|
||||||
return false;
|
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 = new DBusThread;
|
||||||
d->m_thread->start();
|
d->m_thread->start();
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ ActionReply ExternalCommandHelper::init(const QVariantMap& args)
|
||||||
QStringLiteral("/Application"),
|
QStringLiteral("/Application"),
|
||||||
QStringLiteral("org.kde.kpmcore.ping"),
|
QStringLiteral("org.kde.kpmcore.ping"),
|
||||||
QDBusConnection::systemBus());
|
QDBusConnection::systemBus());
|
||||||
iface.setTimeout(5000); // 5 seconds;
|
iface.setTimeout(2000); // 2 seconds;
|
||||||
auto pcall = iface.asyncCall(QStringLiteral("ping"));
|
auto pcall = iface.asyncCall(QStringLiteral("ping"));
|
||||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
|
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
|
||||||
auto exitLoop = [&] (QDBusPendingCallWatcher *watcher) {
|
auto exitLoop = [&] (QDBusPendingCallWatcher *watcher) {
|
||||||
|
|
Loading…
Reference in New Issue