Verified Commit 0994e80e authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Don't hardcode agent DBus service name

Summary:
Use Akonadi::ServerManager instead, it supports Akonadi instances and
is overall preferred over hard-coded strings.

Reviewers: vkrause

Reviewed By: vkrause

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28621
parent 5578f3d2
......@@ -22,6 +22,7 @@
#include <agenttype.h>
#include <agentmanager.h>
#include <agentinstancecreatejob.h>
#include <AkonadiCore/ServerManager>
#include "accountwizard_debug.h"
#include <KLocalizedString>
......@@ -120,7 +121,8 @@ void Resource::instanceCreateResult(KJob *job)
if (!m_settings.isEmpty()) {
Q_EMIT info(i18n("Configuring resource instance..."));
QDBusInterface iface(QStringLiteral("org.freedesktop.Akonadi.Resource.") + m_instance.identifier(), QStringLiteral("/Settings"));
const auto service = ServerManager::agentServiceName(ServerManager::Resource, m_instance.identifier());
QDBusInterface iface(service, QStringLiteral("/Settings"));
if (!iface.isValid()) {
Q_EMIT error(i18n("Unable to configure resource instance."));
return;
......
Markdown is supported
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