Akonadi
itemretrievalmanager.cpp
37 ItemRetrievalManager::ItemRetrievalManager(std::unique_ptr<AbstractItemRetrievalJobFactory> factory, QObject *parent)
55 connect(conn.interface(), &QDBusConnectionInterface::serviceOwnerChanged, this, &ItemRetrievalManager::serviceOwnerChanged);
56 connect(this, &ItemRetrievalManager::requestAdded, this, &ItemRetrievalManager::processRequest, Qt::QueuedConnection);
60 void ItemRetrievalManager::serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner)
70 qCDebug(AKONADISERVER_LOG) << "ItemRetrievalManager lost connection to resource" << serviceName << ", discarding cached interface";
87 std::make_unique<org::freedesktop::Akonadi::Resource>(DBus::agentServiceName(id, DBus::Resource), QStringLiteral("/"), QDBusConnection::sessionBus());
105 qCDebug(AKONADISERVER_LOG) << "ItemRetrievalManager posting retrieval request for items" << req.ids << "to" << req.resourceId << ". There are"
106 << mPendingRequests.size() << "request queues and" << mPendingRequests[req.resourceId].size() << "items mine";
128 connect(job, &AbstractItemRetrievalJob::requestCompleted, this, &ItemRetrievalManager::retrievalJobFinished);
130 // delay job execution until after we unlocked the mutex, since the job can emit the finished signal immediately in some cases
132 qCDebug(AKONADISERVER_LOG) << "ItemRetrievalJob" << job << "started for request" << job->request().id;
146 // someone asked as to process requests although everything is done already, he might still be waiting
179 qCWarning(AKONADISERVER_LOG) << "ItemRetrievalJob for request" << request.id << "finished with error:" << *result.errorMsg;
ItemRetrievalManager(QObject *parent=nullptr)
Use AkThread::create() to create and start a new ItemRetrievalManager thread.
Definition: itemretrievalmanager.cpp:32
const T value(const Key &key) const const
bool isEmpty() const const
Q_EMITQ_EMIT
singleShot
void append(const T &value)
Async D-Bus retrieval, no modification of the request (thus no need for locking)
Definition: itemretrievaljob.h:49
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QHash::iterator insert(const Key &key, const T &value)
Manages and processes item retrieval requests.
Definition: itemretrievalmanager.h:46
QDBusConnection sessionBus()
bool isEmpty() const const
virtual void requestItemDelivery(ItemRetrievalRequest request)
Added for convenience.
Definition: itemretrievalmanager.cpp:102
QueuedConnection
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)
QList::const_iterator cend() const const
QDBusConnectionInterface * interface() const const
void unlock()
int remove(const Key &key)
Details of a single item retrieval request.
Definition: itemretrievalrequest.h:23
A glue between Qt and the standard library.
QReadWriteLock mLock
Protects mPendingRequests and every Request object posted to it.
Definition: itemretrievalmanager.h:87
bool isEmpty() const const
QList::const_iterator cbegin() const const
QHash< QString, AbstractItemRetrievalJob * > mCurrentJobs
Currently running jobs, one per resource.
Definition: itemretrievalmanager.h:94
std::unordered_map< QString, std::list< ItemRetrievalRequest > > mPendingRequests
Pending requests queues, one per resource.
Definition: itemretrievalmanager.h:92
bool contains(const Key &key) const const
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jun 4 2023 03:52:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jun 4 2023 03:52:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.