akonadi
20 #include "asyncselectionhandler_p.h"
22 #include <akonadi/entitytreemodel.h>
24 using namespace Akonadi;
36 AsyncSelectionHandler::~AsyncSelectionHandler()
40 bool AsyncSelectionHandler::scanSubTree(
const QModelIndex &index,
bool searchForItem)
45 if (mItem.id() == id) {
46 emit itemAvailable(index);
52 if (mCollection.
id() == id) {
53 emit collectionAvailable(index);
58 for (
int row = 0; row < mModel->
rowCount(index); ++row) {
60 if (scanSubTree(childIndex, searchForItem)) {
68 void AsyncSelectionHandler::waitForCollection(
const Collection &collection)
70 mCollection = collection;
75 void AsyncSelectionHandler::waitForItem(
const Item &item)
82 void AsyncSelectionHandler::rowsInserted(
const QModelIndex &parent,
int start,
int end)
84 for (
int i = start; i <= end; ++i) {
85 scanSubTree(mModel->
index(i, 0, parent),
false);
86 scanSubTree(mModel->
index(i, 0, parent),
true);
90 #include "moc_asyncselectionhandler_p.cpp"
qlonglong toLongLong(bool *ok) const
virtual int rowCount(const QModelIndex &parent) const =0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
Represents a collection of PIM items.
qint64 Id
Describes the unique id type.
Id id() const
Returns the unique identifier of the entity.
QVariant data(int role) const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.