Commit e0692c1c authored by Volker Krause's avatar Volker Krause
Browse files

Port away from KDBusConnectionPool

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

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D27526
parent 872d988d
......@@ -116,7 +116,6 @@ find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) # for KPluralHan
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED) # pop3, ews
find_package(KF5DocTools ${KF5_MIN_VERSION} CONFIG REQUIRED) # pop3
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
# KdepimLibs package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
......
......@@ -35,7 +35,6 @@ target_link_libraries(akonadi_maildispatcher_agent
KF5::Mime
KF5::MailTransportAkonadi
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::I18n
KF5::Notifications
)
......
......@@ -28,7 +28,6 @@
#include "settings.h"
#include "settingsadaptor.h"
#include <KDBusConnectionPool>
#include <itemfetchscope.h>
#include <mailtransportakonadi/sentactionattribute.h>
#include <mailtransportakonadi/sentbehaviourattribute.h>
......@@ -143,17 +142,17 @@ MailDispatcherAgent::MailDispatcherAgent(const QString &id)
new SettingsAdaptor(Settings::self());
new MailDispatcherAgentAdaptor(this);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
Settings::self(), QDBusConnection::ExportAdaptors);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/MailDispatcherAgent"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/MailDispatcherAgent"),
this, QDBusConnection::ExportAdaptors);
QString service = QStringLiteral("org.freedesktop.Akonadi.MailDispatcherAgent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
}
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
mQueue = new OutboxQueue(this);
connect(mQueue, &OutboxQueue::newItems,
......
......@@ -24,7 +24,7 @@
#include <agentinstance.h>
#include <agentmanager.h>
#include <collection.h>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <item.h>
#include <itemdeletejob.h>
#include <itemmodifyjob.h>
......@@ -103,7 +103,7 @@ void SendJob::doAkonadiTransport()
mInterface = new QDBusInterface(service,
QStringLiteral("/Transport"),
QStringLiteral("org.freedesktop.Akonadi.Resource.Transport"),
KDBusConnectionPool::threadConnection(), this);
QDBusConnection::sessionBus(), this);
if (!mInterface->isValid()) {
storeResult(false, i18n("Failed to get D-Bus interface of resource %1.", mResourceId));
......@@ -294,7 +294,7 @@ bool SendJob::filterItem(int filterset)
QDBusInterface iface(service,
QStringLiteral("/MailFilterAgent"),
QStringLiteral("org.freedesktop.Akonadi.MailFilterAgent"),
KDBusConnectionPool::threadConnection(), this);
QDBusConnection::sessionBus(), this);
if (!iface.isValid()) {
storeResult(false, i18n("Failed to get D-Bus interface of mailfilteragent."));
return false;
......
......@@ -30,7 +30,6 @@ target_link_libraries( akonadi_newmailnotifier_agent
KF5::Codecs
KF5::IdentityManagement
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::Notifications
KF5::Service
KF5::I18n
......
......@@ -29,7 +29,7 @@
#include <AkonadiCore/ServerManager>
#include <KIdentityManagement/IdentityManager>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <changerecorder.h>
#include <entitydisplayattribute.h>
......@@ -67,14 +67,14 @@ NewMailNotifierAgent::NewMailNotifierAgent(const QString &id)
slotIdentitiesChanged();
mDefaultIconName = QStringLiteral("kmail");
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/NewMailNotifierAgent"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/NewMailNotifierAgent"),
this, QDBusConnection::ExportAdaptors);
QString service = QStringLiteral("org.freedesktop.Akonadi.NewMailNotifierAgent");
if (Akonadi::ServerManager::hasInstanceIdentifier()) {
service += QLatin1Char('.') + Akonadi::ServerManager::instanceIdentifier();
}
KDBusConnectionPool::threadConnection().registerService(service);
QDBusConnection::sessionBus().registerService(service);
connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceStatusChanged, this, &NewMailNotifierAgent::slotInstanceStatusChanged);
connect(Akonadi::AgentManager::self(), &Akonadi::AgentManager::instanceRemoved, this, &NewMailNotifierAgent::slotInstanceRemoved);
......
......@@ -36,7 +36,6 @@ target_link_libraries(akonadi_akonotes_resource
KF5::AkonadiMime
KF5::Mime
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::I18n
maildir
folderarchivesettings
......
......@@ -32,7 +32,6 @@ target_link_libraries(akonadi_contacts_resource
KF5::AkonadiCore
KF5::AkonadiAgentBase
KF5::Contacts
KF5::DBusAddons
KF5::I18n
KF5::KIOWidgets
KF5::ConfigWidgets
......
......@@ -29,7 +29,7 @@
#include <collectionfetchscope.h>
#include <entitydisplayattribute.h>
#include <itemfetchscope.h>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include "contacts_resources_debug.h"
#include <KLocalizedString>
......@@ -42,7 +42,7 @@ ContactsResource::ContactsResource(const QString &id)
// setup the resource
ContactsResourceSettings::instance(KSharedConfig::openConfig());
new ContactsResourceSettingsAdaptor(ContactsResourceSettings::self());
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
ContactsResourceSettings::self(), QDBusConnection::ExportAdaptors);
changeRecorder()->fetchCollection(true);
......
......@@ -41,7 +41,7 @@ if( APPLE )
set_target_properties(akonadi_ical_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi iCal Resource")
endif ()
target_link_libraries(akonadi_ical_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase akonadi-singlefileresource KF5::DBusAddons)
target_link_libraries(akonadi_ical_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase akonadi-singlefileresource)
install(TARGETS akonadi_ical_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -26,7 +26,7 @@ qt5_add_dbus_adaptor(notesresource_SRCS
add_executable(akonadi_notes_resource ${notesresource_SRCS})
target_link_libraries(akonadi_notes_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase KF5::DBusAddons akonadi-singlefileresource)
target_link_libraries(akonadi_notes_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase akonadi-singlefileresource)
install(TARGETS akonadi_notes_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -21,7 +21,7 @@
#include "icalresourcebase.h"
#include "icalsettingsadaptor.h"
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <KCalendarCore/FileStorage>
#include <KCalendarCore/MemoryCalendar>
......@@ -45,7 +45,7 @@ void ICalResourceBase::initialise(const QStringList &mimeTypes, const QString &i
{
setSupportedMimetypes(mimeTypes, icon);
new ICalSettingsAdaptor(mSettings);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
mSettings, QDBusConnection::ExportAdaptors);
}
......
......@@ -50,7 +50,6 @@ target_link_libraries(akonadi_kalarm_resource
KF5::CalendarCore
KF5::KIOCore
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::I18n
akonadi-singlefileresource
)
......
......@@ -35,7 +35,6 @@ if( APPLE )
endif ()
target_link_libraries(akonadi_kalarm_dir_resource
KF5::DBusAddons
KF5::KIOCore
KF5::KIOWidgets
KF5::ConfigWidgets
......
......@@ -34,7 +34,7 @@
#include <KCalendarCore/ICalFormat>
#include <KCalendarCore/MemoryCalendar>
#include <changerecorder.h>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <entitydisplayattribute.h>
#include <collectionfetchjob.h>
#include <collectionfetchscope.h>
......@@ -80,7 +80,7 @@ KAlarmDirResource::KAlarmDirResource(const QString &id)
// Set up the resource
new KAlarmDirSettingsAdaptor(mSettings);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
mSettings, QDBusConnection::ExportAdaptors);
connect(mSettings, &Akonadi_KAlarm_Dir_Resource::Settings::configChanged, this, &KAlarmDirResource::settingsChanged);
......
......@@ -43,7 +43,6 @@ target_link_libraries(akonadi_maildir_resource
KF5::AkonadiMime
KF5::Mime
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::I18n
)
......
......@@ -34,7 +34,6 @@
#include <collectionfetchscope.h>
#include <cachepolicy.h>
#include <collectionfetchjob.h>
#include <KDBusConnectionPool>
#include <Akonadi/KMime/MessageFlags>
#include <kmime/kmime_message.h>
#include <AkonadiCore/SpecialCollectionAttribute>
......@@ -115,7 +114,7 @@ MaildirResource::MaildirResource(const QString &id)
job->start();
}
new MaildirSettingsAdaptor(mSettings);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
mSettings, QDBusConnection::ExportAdaptors);
connect(this, &MaildirResource::reloadConfiguration, this, &MaildirResource::configurationChanged);
......
......@@ -53,7 +53,6 @@ target_link_libraries(akonadi_mbox_resource
KF5::KIOCore
KF5::Mime
KF5::AkonadiAgentBase
KF5::DBusAddons
KF5::Completion
akonadi-singlefileresource
)
......
......@@ -24,7 +24,7 @@
#include <changerecorder.h>
#include <collectionfetchjob.h>
#include <collectionmodifyjob.h>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <itemfetchscope.h>
#include <Akonadi/KMime/MessageFlags>
#include <kmbox/mbox.h>
......@@ -66,7 +66,7 @@ MboxResource::MboxResource(const QString &id)
: SingleFileResource<Settings>(id)
{
new SettingsAdaptor(mSettings);
KDBusConnectionPool::threadConnection().registerObject(QStringLiteral("/Settings"),
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Settings"),
mSettings, QDBusConnection::ExportAdaptors);
QStringList mimeTypes;
......
......@@ -35,7 +35,7 @@ if( APPLE )
set_target_properties(akonadi_vcard_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi VCard Resource")
endif ()
target_link_libraries(akonadi_vcard_resource KF5::AkonadiCore KF5::KIOCore KF5::AkonadiAgentBase KF5::Contacts KF5::DBusAddons akonadi-singlefileresource KF5::Completion KF5::KIOWidgets KF5::ConfigWidgets)
target_link_libraries(akonadi_vcard_resource KF5::AkonadiCore KF5::KIOCore KF5::AkonadiAgentBase KF5::Contacts akonadi-singlefileresource KF5::Completion KF5::KIOWidgets KF5::ConfigWidgets)
install(TARGETS akonadi_vcard_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
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