Commit 9d607ce1 authored by Lucas Biaggi's avatar Lucas Biaggi
Browse files

chore(firewalld) cleanup old dbus call

Cleanup unused dbus call.
parent c6c90c8b
Pipeline #135511 passed with stage
in 1 minute and 39 seconds
......@@ -137,44 +137,6 @@ void FirewalldJob::firewalldAction(const QString &bus, const QString &path, cons
}
}
void FirewalldJob::firewalldAction(const QByteArray &method, const QVariantList &args)
{
QDBusMessage call = QDBusMessage::createMethodCall(FIREWALLD::BUS, FIREWALLD::PATH, DIRECT::INTERFACE, method);
call.setArguments(args);
QDBusPendingCall message = QDBusConnection::systemBus().asyncCall(call);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(message, this);
if (args.isEmpty()) {
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *watcher) {
QDBusPendingReply<QList<firewalld_reply>> reply = *watcher;
watcher->deleteLater();
if (reply.isError()) {
setErrorText(reply.error().message());
setError(DBUSFIREWALLDDERROR);
qCDebug(FirewallDJobDebug) << "job error message: " << errorString();
emitResult();
return;
}
m_firewalldreply = reply.value();
emitResult();
return;
});
} else {
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *watcher) {
QDBusPendingReply<> reply = *watcher;
watcher->deleteLater();
if (reply.isError()) {
setErrorText(reply.reply().errorMessage());
setError(DBUSFIREWALLDDERROR);
qCDebug(FirewallDJobDebug) << "job error message: " << errorString();
}
emitResult();
return;
});
}
}
QList<firewalld_reply> FirewalldJob::getFirewalldreply()
{
return m_firewalldreply;
......
......@@ -34,7 +34,6 @@ private:
T connectCall(QDBusPendingCallWatcher *watcher);
void connectCall(QDBusPendingCallWatcher *watcher);
void saveFirewalld();
void firewalldAction(const QByteArray &method, const QVariantList &args = {});
void firewalldAction(const QString &bus, const QString &path, const QString &interface, const QString &method, const QVariantList &args = {});
JobType m_type;
QByteArray m_call;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment