Use QDBusMessage::createMethodCall instead of QDBusInterface

Saves one blocking introspection call
This commit is contained in:
David Redondo 2020-07-01 11:04:59 +02:00
parent ac6bff575f
commit e690b92d3e

View File

@ -32,7 +32,7 @@
#include <KDesktopFile> #include <KDesktopFile>
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QDBusInterface> #include <QDBusConnection>
#include <QDBusPendingCall> #include <QDBusPendingCall>
namespace Plasma namespace Plasma
@ -160,8 +160,9 @@ void PackageStructurePrivate::installPathChanged(const QString &path)
} }
} }
} }
QDBusInterface sycoca(QStringLiteral("org.kde.kded5"), QStringLiteral("/kbuildsycoca")); const auto call = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kded5"), QStringLiteral("/kbuildsycoca"),
sycoca.asyncCall(QStringLiteral("recreate")); QStringLiteral("org.kde.kbuildsycoca"), QStringLiteral("recreate"));
QDBusConnection::sessionBus().asyncCall(call);
} }