Changeset View
Changeset View
Standalone View
Standalone View
src/resource.cpp
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | 02110-1301, USA. | 17 | 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "resource.h" | 20 | #include "resource.h" | ||
21 | 21 | | |||
22 | #include <agenttype.h> | 22 | #include <agenttype.h> | ||
23 | #include <agentmanager.h> | 23 | #include <agentmanager.h> | ||
24 | #include <agentinstancecreatejob.h> | 24 | #include <agentinstancecreatejob.h> | ||
25 | #include <AkonadiCore/ServerManager> | ||||
25 | 26 | | |||
26 | #include "accountwizard_debug.h" | 27 | #include "accountwizard_debug.h" | ||
27 | #include <KLocalizedString> | 28 | #include <KLocalizedString> | ||
28 | 29 | | |||
29 | #include <QMetaMethod> | 30 | #include <QMetaMethod> | ||
30 | #include <QVariant> | 31 | #include <QVariant> | ||
31 | #include <QDBusInterface> | 32 | #include <QDBusInterface> | ||
32 | #include <QDBusReply> | 33 | #include <QDBusReply> | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 115 | if (job->error()) { | |||
115 | Q_EMIT error(i18n("Failed to create resource instance: %1", job->errorText())); | 116 | Q_EMIT error(i18n("Failed to create resource instance: %1", job->errorText())); | ||
116 | return; | 117 | return; | ||
117 | } | 118 | } | ||
118 | 119 | | |||
119 | m_instance = qobject_cast<AgentInstanceCreateJob *>(job)->instance(); | 120 | m_instance = qobject_cast<AgentInstanceCreateJob *>(job)->instance(); | ||
120 | 121 | | |||
121 | if (!m_settings.isEmpty()) { | 122 | if (!m_settings.isEmpty()) { | ||
122 | Q_EMIT info(i18n("Configuring resource instance...")); | 123 | Q_EMIT info(i18n("Configuring resource instance...")); | ||
123 | QDBusInterface iface(QStringLiteral("org.freedesktop.Akonadi.Resource.") + m_instance.identifier(), QStringLiteral("/Settings")); | 124 | const auto service = ServerManager::agentServiceName(ServerManager::Resource, m_instance.identifier()); | ||
125 | QDBusInterface iface(service, QStringLiteral("/Settings")); | ||||
124 | if (!iface.isValid()) { | 126 | if (!iface.isValid()) { | ||
125 | Q_EMIT error(i18n("Unable to configure resource instance.")); | 127 | Q_EMIT error(i18n("Unable to configure resource instance.")); | ||
126 | return; | 128 | return; | ||
127 | } | 129 | } | ||
128 | 130 | | |||
129 | // configure resource | 131 | // configure resource | ||
130 | if (!m_name.isEmpty()) { | 132 | if (!m_name.isEmpty()) { | ||
131 | m_instance.setName(m_name); | 133 | m_instance.setName(m_name); | ||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |