Akonadi
7 #include "akonadicore_debug.h"
8 #include "asyncselectionhandler_p.h"
9 #include "models/entitytreemodel.h"
22 AsyncSelectionHandler::~AsyncSelectionHandler()
26 bool AsyncSelectionHandler::scanSubTree(
const QModelIndex &index,
bool searchForItem)
29 const Item::Id
id = index.
data(EntityTreeModel::ItemIdRole).
toLongLong();
31 if (mItem.id() ==
id) {
32 Q_EMIT itemAvailable(index);
38 if (mCollection.id() ==
id) {
39 Q_EMIT collectionAvailable(index);
44 for (
int row = 0; row < mModel->rowCount(index); ++row) {
45 const QModelIndex childIndex = mModel->index(row, 0, index);
48 qCWarning(AKONADICORE_LOG) <<
"Invalid child detected: " << index.
data().
toString();
52 if (scanSubTree(childIndex, searchForItem)) {
60 void AsyncSelectionHandler::waitForCollection(
const Collection &collection)
62 mCollection = collection;
67 void AsyncSelectionHandler::waitForItem(
const Item &item)
74 void AsyncSelectionHandler::rowsInserted(
const QModelIndex &parent,
int start,
int end)
77 scanSubTree(mModel->index(i, 0, parent),
false);
78 scanSubTree(mModel->index(i, 0, parent),
true);
82 #include "moc_asyncselectionhandler_p.cpp"
Q_SCRIPTABLE Q_NOREPLY void start()
Represents a collection of PIM items.
qlonglong toLongLong(bool *ok) const const
QVariant data(int role) const const
bool isValid() const const
void rowsInserted(const QModelIndex &parent, int first, int last)
qint64 Id
Describes the unique id type.
const QList< QKeySequence > & end()
Represents a PIM item stored in Akonadi storage.
QString toString() const const
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jun 30 2022 03:51:45 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.