summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <[email protected]>2017-06-29 15:22:07 -0400
committerAllen Winter <[email protected]>2017-06-29 15:22:07 -0400
commit7267bfd92119ba8a506b4e276e7a176dd2d6b218 (patch)
treec846cc077be114ef178e87cd28b9fcbef1978907
parent0ec63e84f66769b622e00dc0cfe9353d23b319ad (diff)
manageserversidesubscriptionjob.cpp - fix manage serverside subscription for Akonadi instances
-rw-r--r--src/pimcommonakonadi/manageserversidesubscription/manageserversidesubscriptionjob.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/pimcommonakonadi/manageserversidesubscription/manageserversidesubscriptionjob.cpp b/src/pimcommonakonadi/manageserversidesubscription/manageserversidesubscriptionjob.cpp
index ee175cc..254d1f0 100644
--- a/src/pimcommonakonadi/manageserversidesubscription/manageserversidesubscriptionjob.cpp
+++ b/src/pimcommonakonadi/manageserversidesubscription/manageserversidesubscriptionjob.cpp
@@ -18,12 +18,16 @@
#include "manageserversidesubscriptionjob.h"
#include "util/mailutil.h"
#include "pimcommonakonadi_debug.h"
+
+#include <AkonadiCore/ServerManager>
+
+#include <KDBusConnectionPool>
#include <KLocalizedString>
+#include <KMessageBox>
+
#include <QDBusInterface>
#include <QDBusPendingCall>
#include <QDBusPendingReply>
-#include <kdbusconnectionpool.h>
-#include <KMessageBox>
using namespace PimCommon;
@@ -61,12 +65,14 @@ void ManageServerSideSubscriptionJob::start()
}
bool isImapOnline = false;
if (PimCommon::MailUtil::isImapFolder(d->mCurrentCollection, isImapOnline)) {
- QDBusInterface iface(
- QLatin1String("org.freedesktop.Akonadi.Resource.") + d->mCurrentCollection.resource(),
+ const QString service =
+ Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Resource,
+ d->mCurrentCollection.resource());
+ QDBusInterface iface(service,
QStringLiteral("/"), QStringLiteral("org.kde.Akonadi.ImapResourceBase"),
KDBusConnectionPool::threadConnection(), this);
if (!iface.isValid()) {
- qCDebug(PIMCOMMONAKONADI_LOG) << "Cannot create imap dbus interface";
+ qCDebug(PIMCOMMONAKONADI_LOG) << "Cannot create imap dbus interface for service " << service;
deleteLater();
return;
}
@@ -102,4 +108,3 @@ void ManageServerSideSubscriptionJob::setCurrentCollection(const Akonadi::Collec
{
d->mCurrentCollection = col;
}
-