Commit c1f5a762 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/D27549
parent 9eff0664
......@@ -35,7 +35,6 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADIMIME
########### Find packages ###########
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -24,9 +24,9 @@ target_link_libraries(akonadi_benchmarker
KF5::Mime
Qt5::Test
KF5::AkonadiCore
KF5::DBusAddons
KF5::I18n
Qt5::Widgets
Qt5::DBus
)
install(TARGETS akonadi_benchmarker ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -20,8 +20,6 @@
#include "test.h"
#include "KDBusConnectionPool"
#include <agentinstancecreatejob.h>
#include <collectiondeletejob.h>
#include <collectionfetchjob.h>
......@@ -29,6 +27,7 @@
#include <QDebug>
#include <QTest>
#include <QDBusConnection>
#include <QDBusInterface>
using namespace Akonadi;
......@@ -62,7 +61,7 @@ void MakeTest::createAgent(const QString &name)
void MakeTest::configureDBusIface(const QString &name, const QString &dir)
{
QDBusInterface *configIface = new QDBusInterface(QLatin1String("org.freedesktop.Akonadi.Resource.") + currentInstance.identifier(),
QStringLiteral("/Settings"), QLatin1String("org.kde.Akonadi.") + name + QLatin1String(".Settings"), KDBusConnectionPool::threadConnection(), this);
QStringLiteral("/Settings"), QLatin1String("org.kde.Akonadi.") + name + QLatin1String(".Settings"), QDBusConnection::sessionBus(), this);
configIface->call(QStringLiteral("setPath"), dir);
configIface->call(QStringLiteral("setReadOnly"), true);
......
......@@ -20,9 +20,9 @@
#include "localfolderstest.h"
#include "collectionpathresolver.h"
#include "kdbusconnectionpool.h"
#include "specialmailcollectionssettings.h"
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QFile>
#include <QSignalSpy>
......@@ -91,13 +91,13 @@ void LocalFoldersTest::testLock()
}
// Initially not locked.
QVERIFY(!KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(dbusName));
QVERIFY(!QDBusConnection::sessionBus().interface()->isServiceRegistered(dbusName));
// Get the lock.
{
GetLockJob *ljob = new GetLockJob(this);
AKVERIFYEXEC(ljob);
QVERIFY(KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(dbusName));
QVERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(dbusName));
}
// Getting the lock again should fail.
......@@ -107,9 +107,9 @@ void LocalFoldersTest::testLock()
}
// Release the lock.
QVERIFY(KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(dbusName));
QVERIFY(QDBusConnection::sessionBus().interface()->isServiceRegistered(dbusName));
releaseLock();
QVERIFY(!KDBusConnectionPool::threadConnection().interface()->isServiceRegistered(dbusName));
QVERIFY(!QDBusConnection::sessionBus().interface()->isServiceRegistered(dbusName));
}
void LocalFoldersTest::testInitialState()
......
......@@ -81,7 +81,6 @@ target_link_libraries(KF5AkonadiMime
KF5::Mime
KF5::AkonadiWidgets
KF5::KIOCore
KF5::DBusAddons
KF5::I18n
KF5::ConfigWidgets
KF5::XmlGui
......
......@@ -21,7 +21,7 @@
#include "imapsettings.h"
#include <servermanager.h>
#include <KDBusConnectionPool>
#include <QDBusConnection>
#include <assert.h>
#include "akonadi_mime_debug.h"
......@@ -48,6 +48,6 @@ OrgKdeAkonadiImapSettingsInterface *createImapSettingsInterface(const QString &i
//NOTE(Andras): from kmail/util.cpp
return new OrgKdeAkonadiImapSettingsInterface(Akonadi::ServerManager::agentServiceName(Akonadi::ServerManager::Resource, ident),
QStringLiteral("/Settings"),
KDBusConnectionPool::threadConnection());
QDBusConnection::sessionBus());
}
}
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