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
14#include <qdbusextratypes.h>
15
16using namespace Akonadi;
17
18Connection *ChangeNotificationDependenciesFactory::createNotificationConnection(Session *session, CommandBuffer *commandBuffer)
19{
20 if (!Akonadi::ServerManager::self()->isRunning()) {
21 return nullptr;
22 }
23
24 auto connection = new Connection(Connection::NotificationConnection, session->sessionId(), commandBuffer);
25 addConnection(session, connection);
26 return connection;
27}
28
29void ChangeNotificationDependenciesFactory::addConnection(Session *session, Connection *connection)
30{
31 session->d->sessionThread()->addConnection(connection);
32}
33
34void ChangeNotificationDependenciesFactory::destroyNotificationConnection(Session *session, Connection *connection)
35{
36 session->d->sessionThread()->destroyConnection(connection);
37}
38
39QObject *ChangeNotificationDependenciesFactory::createChangeMediator(QObject *parent)
40{
41 Q_UNUSED(parent)
42 return ChangeMediator::instance();
43}
44
45CollectionCache *ChangeNotificationDependenciesFactory::createCollectionCache(int maxCapacity, Session *session)
46{
47 return new CollectionCache(maxCapacity, session);
48}
49
50ItemCache *ChangeNotificationDependenciesFactory::createItemCache(int maxCapacity, Session *session)
51{
52 return new ItemCache(maxCapacity, session);
53}
54
55ItemListCache *ChangeNotificationDependenciesFactory::createItemListCache(int maxCapacity, Session *session)
56{
57 return new ItemListCache(maxCapacity, session);
58}
59
60TagListCache *ChangeNotificationDependenciesFactory::createTagListCache(int maxCapacity, Session *session)
61{
62 return new TagListCache(maxCapacity, session);
63}
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-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.