Akonadi

changenotificationdependenciesfactory.cpp
1/*
2 SPDX-FileCopyrightText: 2011 Stephen Kelly <steveire@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "changemediator_p.h"
8#include "changenotificationdependenciesfactory_p.h"
9#include "connection_p.h"
10#include "servermanager.h"
11#include "session_p.h"
12#include "sessionthread_p.h"
13
14using namespace Akonadi;
15
16Connection *ChangeNotificationDependenciesFactory::createNotificationConnection(Session *session, CommandBuffer *commandBuffer)
17{
18 if (!Akonadi::ServerManager::self()->isRunning()) {
19 return nullptr;
20 }
21
22 auto connection = new Connection(Connection::NotificationConnection, session->sessionId(), commandBuffer);
23 addConnection(session, connection);
24 return connection;
25}
26
27void ChangeNotificationDependenciesFactory::addConnection(Session *session, Connection *connection)
28{
29 session->d->sessionThread()->addConnection(connection);
30}
31
32void ChangeNotificationDependenciesFactory::destroyNotificationConnection(Session *session, Connection *connection)
33{
34 session->d->sessionThread()->destroyConnection(connection);
35}
36
37QObject *ChangeNotificationDependenciesFactory::createChangeMediator(QObject *parent)
38{
39 Q_UNUSED(parent)
40 return ChangeMediator::instance();
41}
42
43CollectionCache *ChangeNotificationDependenciesFactory::createCollectionCache(int maxCapacity, Session *session)
44{
45 return new CollectionCache(maxCapacity, session);
46}
47
48ItemCache *ChangeNotificationDependenciesFactory::createItemCache(int maxCapacity, Session *session)
49{
50 return new ItemCache(maxCapacity, session);
51}
52
53ItemListCache *ChangeNotificationDependenciesFactory::createItemListCache(int maxCapacity, Session *session)
54{
55 return new ItemListCache(maxCapacity, session);
56}
57
58TagListCache *ChangeNotificationDependenciesFactory::createTagListCache(int maxCapacity, Session *session)
59{
60 return new TagListCache(maxCapacity, session);
61}
static ServerManager * self()
Returns the singleton instance of this class, for connecting to its signals.
ASAP CLI session.
Helper integration between Akonadi and Qt.
NETWORKMANAGERQT_EXPORT QDBusPendingReply< QDBusObjectPath > addConnection(const NMVariantMapMap &settings)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 11:53:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.