Commit 782e12de authored by Volker Krause's avatar Volker Krause
Browse files

Remove usage of KDBusConnectionPool

Summary:
As per T12722 this is no longer needed, QDBusConnection now behaves
correctly in a multi-threaded scenario.

Reviewers: mlaurent

Reviewed By: mlaurent

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D27567
parent d82d8098
......@@ -24,7 +24,7 @@
#include <AkonadiCore/ServerManager>
#include <MailCommon/MailKernel>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <Monitor>
#include <Session>
#include <CollectionFetchScope>
......@@ -55,11 +55,11 @@ ArchiveMailAgent::ArchiveMailAgent(const QString &id)
collectionMonitor->setMimeTypeMonitored(KMime::Message::mimeType());
new ArchiveMailAgentAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/ArchiveMailAgent"), this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/ArchiveMailAgent"), this, QDBusConnection::ExportAdaptors);
const QString service = Akonadi::ServerManager::self()->agentServiceName(Akonadi::ServerManager::Agent, identifier());
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
connect(collectionMonitor, &Akonadi::Monitor::collectionRemoved, this, &ArchiveMailAgent::mailCollectionRemoved);
if (enabledAgent()) {
......
......@@ -26,7 +26,7 @@
#include <AkonadiCore/ChangeRecorder>
#include <AkonadiCore/ItemFetchScope>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <Kdelibs4ConfigMigrator>
#include <AkonadiCore/Session>
......@@ -44,9 +44,9 @@ FollowUpReminderAgent::FollowUpReminderAgent(const QString &id)
migrate.migrate();
new FollowUpReminderAgentAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/FollowUpReminder"), this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/FollowUpReminder"), this, QDBusConnection::ExportAdaptors);
const QString service = Akonadi::ServerManager::self()->agentServiceName(Akonadi::ServerManager::Agent, QStringLiteral("akonadi_followupreminder_agent"));
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
mManager = new FollowUpReminderManager(this);
setNeedsNetwork(true);
......
......@@ -30,7 +30,7 @@
#include <AkonadiCore/changerecorder.h>
#include <AkonadiCore/collectionfetchjob.h>
#include <AkonadiCore/collectionfetchscope.h>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <AkonadiCore/itemfetchscope.h>
#include <Akonadi/KMime/MessageParts>
#include <Akonadi/KMime/MessageStatus>
......@@ -101,11 +101,11 @@ MailFilterAgent::MailFilterAgent(const QString &id)
new MailFilterAgentAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/MailFilterAgent"), this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/MailFilterAgent"), this, QDBusConnection::ExportAdaptors);
const QString service = Akonadi::ServerManager::self()->agentServiceName(Akonadi::ServerManager::Agent, QStringLiteral("akonadi_mailfilter_agent"));
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
//Enabled or not filterlogdialog
KSharedConfig::Ptr config = KSharedConfig::openConfig();
if (config->hasGroup("FilterLog")) {
......
......@@ -30,7 +30,7 @@
#include <Akonadi/KMime/SpecialMailCollections>
#include <AgentInstance>
#include <AgentManager>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <changerecorder.h>
#include <itemfetchscope.h>
#include <AkonadiCore/session.h>
......@@ -56,11 +56,11 @@ SendLaterAgent::SendLaterAgent(const QString &id)
mManager = new SendLaterManager(this);
connect(mManager, &SendLaterManager::needUpdateConfigDialogBox, this, &SendLaterAgent::needUpdateConfigDialogBox);
new SendLaterAgentAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/SendLaterAgent"), this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/SendLaterAgent"), this, QDBusConnection::ExportAdaptors);
const QString service = Akonadi::ServerManager::self()->agentServiceName(Akonadi::ServerManager::Agent, QStringLiteral("akonadi_sendlater_agent"));
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
changeRecorder()->setMimeTypeMonitored(KMime::Message::mimeType());
changeRecorder()->itemFetchScope().setCacheOnly(true);
......
......@@ -43,7 +43,7 @@
#include <KIdentityManagement/Identity>
#include <KLocalizedString>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <QPointer>
#include <QTimer>
......@@ -59,9 +59,9 @@ UnifiedMailboxAgent::UnifiedMailboxAgent(const QString &id)
setAgentName(i18n("Unified Mailboxes"));
new UnifiedMailboxAgentAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/UnifiedMailboxAgent"), this, QDBusConnection::ExportAdaptors);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/UnifiedMailboxAgent"), this, QDBusConnection::ExportAdaptors);
const auto service = Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Resource, identifier());
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
connect(&mBoxManager, &UnifiedMailboxManager::updateBox,
this, [this](const UnifiedMailbox *box) {
......
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