Remove ping interface in KAuth helper as it is blocking KPM GUI.

This commit is contained in:
Andrius Štikonas 2018-03-31 18:01:00 +01:00
parent 1062766e36
commit 5e85f0b974
3 changed files with 0 additions and 30 deletions

View File

@ -26,7 +26,6 @@
#include <QDBusInterface>
#include <QStringList>
#include <QString>
#include <QTimer>
#include <QVector>
#include <QUuid>
@ -86,22 +85,6 @@ void CoreBackendManager::startExternalCommandHelper()
QObject::connect(job(), &KJob::finished, [=] () { if(d->m_job->error()) exitLoop(); } );
loop.exec();
QObject::disconnect(conn);
// Watchdog Timer for the DBus service
QTimer *timer = new QTimer;
auto sendDBusPing = [&] () {
QDBusInterface iface(QStringLiteral("org.kde.kpmcore.helperinterface"),
QStringLiteral("/Helper"),
QStringLiteral("org.kde.kpmcore.externalcommand"),
QDBusConnection::systemBus());
if (iface.isValid())
iface.call(QStringLiteral("ping"), CoreBackendManager::self()->Uuid());
};
QObject::connect(timer, &QTimer::timeout, sendDBusPing);
timer->start(20000); // 20 seconds
}
void CoreBackendManager::stopExternalCommandHelper()

View File

@ -48,10 +48,6 @@ ActionReply ExternalCommandHelper::init(const QVariantMap& args)
}
QDBusConnection::systemBus().registerObject(QStringLiteral("/Helper"), this, QDBusConnection::ExportAllSlots);
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, [=] () { exit(m_callerUuid); });
timer->start(TIMEOUT);
HelperSupport::progressStep(QVariantMap());
m_loop.exec();
reply.addData(QStringLiteral("success"), true);
@ -244,14 +240,6 @@ void ExternalCommandHelper::exit(const QString& Uuid)
QDBusConnection::systemBus().unregisterObject(QStringLiteral("/Helper"));
}
void ExternalCommandHelper::ping(const QString &Uuid)
{
if (!isCallerAuthorized(Uuid))
return;
timer->setInterval(TIMEOUT);
}
void ExternalCommandHelper::onReadOutput()
{
// const QByteArray s = cmd.readAllStandardOutput();

View File

@ -46,7 +46,6 @@ public Q_SLOTS:
Q_SCRIPTABLE QVariantMap start(const QString& Uuid, const QString& command, const QStringList& arguments, const QByteArray& input, const QStringList& environment);
Q_SCRIPTABLE bool copyblocks(const QString& Uuid, const QString& sourceDevice, const qint64 sourceFirstByte, const qint64 sourceLength, const QString& targetDevice, const qint64 targetFirstByte, const qint64 blockSize);
Q_SCRIPTABLE void exit(const QString& Uuid);
Q_SCRIPTABLE void ping(const QString& Uuid);
private:
void onReadOutput();