#include <klflibview_p.h>
Classes | |
struct | CategoryLabelNode |
struct | EntryNode |
class | KLFLibModelSorter |
struct | Node |
class | NodeCache |
struct | NodeId |
Public Types | |
enum | ItemKind { EntryKind = KLFLibModel::EntryKind, CategoryLabelKind = KLFLibModel::CategoryLabelKind } |
typedef qint32 | IndexType |
typedef quint32 | UIDType |
typedef NodeCache< EntryNode > | EntryCache |
typedef NodeCache < CategoryLabelNode > | CategoryLabelCache |
Public Member Functions | |
KLFLibModelCache (KLFLibModel *model) | |
virtual | ~KLFLibModelCache () |
void | rebuildCache () |
QModelIndex | createIndexFromId (NodeId nodeid, int row, int column) |
NodeId | getNodeForIndex (const QModelIndex &index) |
Node | getNode (NodeId nodeid) |
Node & | getNodeRef (NodeId nodeid) |
EntryNode & | getEntryNodeRef (NodeId nodeid, bool requireNotMinimalist=false) |
CategoryLabelNode & | getCategoryLabelNodeRef (NodeId nodeid) |
int | getNodeRow (NodeId nodeid) |
void | ensureNotMinimalist (NodeId nodeId, int count=-1) |
bool | canFetchMore (NodeId parentId) |
void | fetchMore (NodeId parentId, int batchCount=-1) |
void | updateData (const QList< KLFLib::entryId > &entryIdList, int modifyType) |
void | treeInsertEntry (const EntryNode &e, bool isRebuildingCache=false) |
EntryNode | treeTakeEntry (const NodeId &e, bool notifyQtApi=true) |
IndexType | cacheFindCategoryLabel (QStringList catelements, bool createIfNotExists=false, bool notifyQtApi=false, bool newlyCreatedAreChildrenFetched=true) |
QString | nodeValue (NodeId node, int propId=KLFLibEntry::Latex) |
bool | searchNodeMatches (const NodeId &nodeId, const QString &searchString, Qt::CaseSensitivity cs) |
void | setSortingBy (int propId, Qt::SortOrder order) |
void | sortCategory (NodeId category, KLFLibModelSorter *sorter, bool rootCall=true) |
NodeId | nextNode (NodeId n) |
NodeId | prevNode (NodeId n) |
NodeId | lastNode (NodeId n) |
QList< KLFLib::entryId > | entryIdList (const QModelIndexList &indexlist) |
QList< KLFLib::entryId > | entryIdForIndexList (const QModelIndexList &indexlist) |
QModelIndexList | findEntryIdList (const QList< KLFLib::entryId > &eidlist) |
NodeId | findEntryId (KLFLib::entryId eId) |
QStringList | categoryListCache () |
void | fullDump () |
void | dumpNodeTree (NodeId node, int indent=0) |
Static Public Member Functions | |
static QList< int > | minimalistEntryPropIds () |
Public Attributes | |
EntryNode | pInvalidEntryNode |
KLFLibModel * | pModel |
Static Public Attributes | |
static const quint8 | UIDKindShift = 30 |
static const UIDType | UIDKindMask = 0xC0000000 |
static const UIDType | UIDIndexMask = 0x3FFFFFFF |
static const UIDType | UIDInvalid = 0xFFFFFFFF |
Definition at line 72 of file klflibview_p.h.
Definition at line 206 of file klflibview_p.h.
Definition at line 205 of file klflibview_p.h.
typedef qint32 KLFLibModelCache::IndexType |
Definition at line 75 of file klflibview_p.h.
typedef quint32 KLFLibModelCache::UIDType |
UIDType standing for UniversalIdType: on 32 bits:
mask shift for Node Kind: 30 bits mask for Node Kind: 0x c0000000 mask for Node Index: 0x 3FFFFFFF
Definition at line 83 of file klflibview_p.h.
Enumerator | |
---|---|
EntryKind | |
CategoryLabelKind |
Definition at line 89 of file klflibview_p.h.
|
inline |
Definition at line 212 of file klflibview_p.h.
References KLFLibEntry::DateTime.
|
inlinevirtual |
Definition at line 221 of file klflibview_p.h.
KLFLibModelCache::IndexType KLFLibModelCache::cacheFindCategoryLabel | ( | QStringList | catelements, |
bool | createIfNotExists = false , |
||
bool | notifyQtApi = false , |
||
bool | newlyCreatedAreChildrenFetched = true |
||
) |
emits QAbstractItemModel-appropriate signals and updates indexes if notifyQtApi
is true.
If newlyCreatedAreChildrenFetched
is TRUE, then any newly created CategoryLabelNode will have its allChildrenFetched
flag set to TRUE (eg. when updating data, a new entry was changed category to a yet-inexistant category). If the parameter is FALSE, then any newly created CategoryLabelNode will have its allChildrenFetched
flag set to FALSE (eg. when rebuilding the cache).
Definition at line 1116 of file klflibview.cpp.
References KLFLibModelCache::Node::allChildrenFetched, QList::begin(), QAbstractItemModel::beginInsertRows(), KLFLibModelCache::CategoryLabelNode::categoryLabel, CategoryLabelKind, KLFLibModel::CategoryTree, KLFLibModelCache::Node::children, createIndexFromId(), KLFLibModel::displayType(), QList::end(), QAbstractItemModel::endInsertRows(), KLFLibModelCache::CategoryLabelNode::fullCategoryPath, KLFLibModel::GroupSubCategories, QList::insert(), KLFLibModelCache::NodeCache< N >::insertNewNode(), KLFLibModelCache::NodeCache< N >::isAllocated(), QStringList::join(), KLF_FUNC_NAME, klfDbg, pModel, and QList::size().
Referenced by rebuildCache(), and treeInsertEntry().
bool KLFLibModelCache::canFetchMore | ( | NodeId | parentId | ) |
Definition at line 714 of file klflibview.cpp.
References KLFLibModelCache::Node::allChildrenFetched, getNodeRef(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibModelCache::NodeId::rootNode(), and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::canFetchMore(), createIndexFromId(), lastNode(), nextNode(), and treeInsertEntry().
|
inline |
Definition at line 359 of file klflibview_p.h.
Referenced by KLFLibModel::categoryList().
QModelIndex KLFLibModelCache::createIndexFromId | ( | NodeId | nodeid, |
int | row, | ||
int | column | ||
) |
If row is negative, it will be looked up automatically.
Definition at line 533 of file klflibview.cpp.
References canFetchMore(), QAbstractItemModel::createIndex(), fetchMore(), getNode(), getNodeRow(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, klfDbgT, KLFLibModelCache::Node::parent, pModel, KLFLibModelCache::NodeId::rootNode(), KLFLibModelCache::NodeId::universalId(), and KLFLibModelCache::NodeId::valid().
Referenced by cacheFindCategoryLabel(), fetchMore(), findEntryIdList(), KLFLibModel::index(), KLFLibModel::parent(), KLFLibModel::searchFindNext(), treeInsertEntry(), treeTakeEntry(), updateData(), KLFLibModel::walkNextIndex(), and KLFLibModel::walkPrevIndex().
void KLFLibModelCache::dumpNodeTree | ( | NodeId | node, |
int | indent = 0 |
||
) |
Definition at line 1465 of file klflibview.cpp.
References CategoryLabelKind, KLFLibModelCache::Node::children, EntryKind, getCategoryLabelNodeRef(), getEntryNodeRef(), getNode(), KLFLibModelCache::NodeId::kind, and KLFLibModelCache::NodeId::valid().
Referenced by fullDump().
void KLFLibModelCache::ensureNotMinimalist | ( | NodeId | nodeId, |
int | count = -1 |
||
) |
Updates count
entry nodes in tree after (and including nodeId
), if they are marked as "minimalist" (see EntryNode)
If count is -1, uses pModel->fetchBatchCount().
Definition at line 672 of file klflibview.cpp.
References CategoryLabelKind, QMap::contains(), KLFLibResourceEngine::entries(), KLFLibModelCache::EntryNode::entryid, EntryKind, getEntryNodeRef(), KLFLibModelCache::NodeId::index, QMap::keys(), KLFLibModelCache::NodeId::kind, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibModelCache::EntryNode::minimalist, nextNode(), pModel, QList::size(), and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::data(), getEntryNodeRef(), and KLFLibModel::prefetch().
QList< KLFLib::entryId > KLFLibModelCache::entryIdForIndexList | ( | const QModelIndexList & | indexlist | ) |
Returns a list of same size as indexlist
in which each entry is exactly the entryId of the corresponding index in indexlist
, setting -1 if it isn't an entry index.
Definition at line 1388 of file klflibview.cpp.
References KLFLibModelCache::EntryNode::entryid, EntryKind, getEntryNodeRef(), getNodeForIndex(), KLFLibModelCache::NodeId::kind, and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::entryIdForIndexList().
QList< KLFLib::entryId > KLFLibModelCache::entryIdList | ( | const QModelIndexList & | indexlist | ) |
Returns a list of all valid entryIds in the index list. ORDER of result is not garanteed and invalid indexes are ignored, as opposed to entryIdForIndexList().
Definition at line 1366 of file klflibview.cpp.
References QList::contains(), KLFLibModelCache::EntryNode::entryid, EntryKind, getEntryNodeRef(), getNodeForIndex(), KLFLibModelCache::NodeId::kind, and KLFLibModelCache::NodeId::valid().
void KLFLibModelCache::fetchMore | ( | NodeId | parentId, |
int | batchCount = -1 |
||
) |
Definition at line 735 of file klflibview.cpp.
References KLFLibModelCache::Node::allChildrenFetched, QList::append(), QAbstractItemModel::beginInsertRows(), KLFLibEntry::Category, CategoryLabelKind, KLFLibModel::CategoryTree, KLFLibModelCache::Node::children, createIndexFromId(), KLFLibResourceEngine::defaultSubResource(), QAbstractItemModel::endInsertRows(), KLFLibModelCache::EntryNode::entry, KLFLibResourceEngine::KLFLibEntryWithId::entry, KLFLibModelCache::EntryNode::entryid, EntryKind, KLFLibResourceEngine::QueryResult::entryWithIdList, KLFLibResourceEngine::QueryResult::FillEntryWithIdList, KLFLibModelCache::CategoryLabelNode::fullCategoryPath, fullDump(), getCategoryLabelNodeRef(), KLFLibResourceEngine::KLFLibEntryWithId::id, KLFLibModelCache::NodeId::index, KLFLibModelCache::NodeId::kind, KLFLibModelCache::Node::kind, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibResourceEngine::Query::limit, KLFLibResourceEngine::Query::matchCondition, KLFLibModelCache::EntryNode::minimalist, minimalistEntryPropIds(), KLFLib::EntryMatchCondition::mkPropertyMatch(), KLFLibEntry::normalizeCategoryPath(), KLFLibResourceEngine::Query::orderDirection, KLFLibResourceEngine::Query::orderPropId, KLFLibModelCache::Node::parent, pModel, KLFLibResourceEngine::query(), KLFLibModelCache::NodeId::rootNode(), QList::size(), KLFLibResourceEngine::Query::skip, KLFLibModel::url(), KLFLibModelCache::NodeId::valid(), and KLFLibResourceEngine::Query::wantedEntryProperties.
Referenced by createIndexFromId(), KLFLibModel::fetchMore(), lastNode(), nextNode(), and treeInsertEntry().
KLFLibModelCache::NodeId KLFLibModelCache::findEntryId | ( | KLFLib::entryId | eId | ) |
Definition at line 1428 of file klflibview.cpp.
References EntryKind, klfDbg, and QList::size().
Referenced by updateData().
QModelIndexList KLFLibModelCache::findEntryIdList | ( | const QList< KLFLib::entryId > & | eidlist | ) |
Definition at line 1404 of file klflibview.cpp.
References createIndexFromId(), EntryKind, QList::indexOf(), klfDbg, and QList::size().
Referenced by KLFLibModel::findEntryIdList().
void KLFLibModelCache::fullDump | ( | ) |
Definition at line 1441 of file klflibview.cpp.
References dumpNodeTree(), KLFLibModelCache::NodeId::rootNode(), and QList::size().
Referenced by fetchMore(), rebuildCache(), and updateData().
KLFLibModelCache::CategoryLabelNode & KLFLibModelCache::getCategoryLabelNodeRef | ( | NodeId | nodeid | ) |
Definition at line 635 of file klflibview.cpp.
References CategoryLabelKind, KLFLibModelCache::NodeId::index, KLFLibModelCache::NodeId::kind, QList::size(), and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::data(), KLFLibModel::dropMimeData(), dumpNodeTree(), fetchMore(), KLFLibModel::index(), nodeValue(), KLFLibModelCache::KLFLibModelSorter::operator()(), and treeInsertEntry().
KLFLibModelCache::EntryNode & KLFLibModelCache::getEntryNodeRef | ( | NodeId | nodeid, |
bool | requireNotMinimalist = false |
||
) |
Definition at line 621 of file klflibview.cpp.
References ensureNotMinimalist(), EntryKind, KLFLibModelCache::NodeId::index, KLFLibModelCache::NodeId::kind, QList::size(), and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::data(), KLFLibModel::dragImage(), dumpNodeTree(), ensureNotMinimalist(), entryIdForIndexList(), entryIdList(), KLFLibModel::mimeData(), nodeValue(), KLFLibModelCache::KLFLibModelSorter::operator()(), and treeTakeEntry().
KLFLibModelCache::Node KLFLibModelCache::getNode | ( | NodeId | nodeid | ) |
Returns empty node for invalid indexes, not root nodem.
Definition at line 591 of file klflibview.cpp.
References getNodeRef(), and KLFLibModelCache::NodeId::valid().
Referenced by createIndexFromId(), KLFLibModel::data(), dumpNodeTree(), getNodeRow(), KLFLibModel::hasChildren(), lastNode(), nextNode(), KLFLibModel::parent(), prevNode(), KLFLibModel::rowCount(), and treeTakeEntry().
KLFLibModelCache::NodeId KLFLibModelCache::getNodeForIndex | ( | const QModelIndex & | index | ) |
Returns an invalid ID upon invalid index.
Definition at line 568 of file klflibview.cpp.
References CategoryLabelKind, EntryKind, KLFLibModelCache::NodeId::fromUID(), KLFLibModelCache::NodeId::index, QModelIndex::internalId(), QModelIndex::isValid(), KLFLibModelCache::NodeId::kind, KLF_FUNC_NAME, and QList::size().
Referenced by KLFLibModel::canFetchMore(), KLFLibModel::data(), KLFLibModel::dragImage(), KLFLibModel::dropMimeData(), entryIdForIndexList(), entryIdList(), KLFLibModel::fetchMore(), KLFLibModel::flags(), KLFLibModel::hasChildren(), KLFLibModel::index(), KLFLibModel::mimeData(), KLFLibModel::parent(), KLFLibModel::prefetch(), KLFLibModel::rowCount(), KLFLibModel::searchFindNext(), KLFLibModel::walkNextIndex(), and KLFLibModel::walkPrevIndex().
KLFLibModelCache::Node & KLFLibModelCache::getNodeRef | ( | NodeId | nodeid | ) |
Definition at line 598 of file klflibview.cpp.
References CategoryLabelKind, EntryKind, KLFLibModelCache::NodeId::index, KLFLibModelCache::NodeId::kind, pInvalidEntryNode, QList::size(), and KLFLibModelCache::NodeId::valid().
Referenced by canFetchMore(), getNode(), treeInsertEntry(), and treeTakeEntry().
int KLFLibModelCache::getNodeRow | ( | NodeId | nodeid | ) |
get the row of nodeid
in its parent.
Definition at line 645 of file klflibview.cpp.
References KLFLibModelCache::Node::children, getNode(), KLF_FUNC_NAME, KLFLibModelCache::Node::parent, KLFLibModelCache::NodeId::rootNode(), and KLFLibModelCache::NodeId::valid().
Referenced by createIndexFromId(), nextNode(), and prevNode().
KLFLibModelCache::NodeId KLFLibModelCache::lastNode | ( | NodeId | n | ) |
Returns the last node in tree defined by node n
.
If n
has children, returns last child of the last child of the last child etc. If n
does not have children, it is itself returned.
If NULL
is given, the root node is assumed.
Definition at line 1339 of file klflibview.cpp.
References KLFLibModelCache::Node::allChildrenFetched, canFetchMore(), KLFLibModelCache::Node::children, fetchMore(), getNode(), KLF_FUNC_NAME, KLFLibModelCache::NodeId::rootNode(), and KLFLibModelCache::NodeId::valid().
Referenced by prevNode().
|
inlinestatic |
define here what prop ids are stored in minimalist entries. Warning: some functions may make some assumptions on what minimalist entries have, and these properties must make sense here (eg. PreviewSize for delegate's sizeHint(), Category for creating the tree, etc.)
Definition at line 246 of file klflibview_p.h.
References KLFLibEntry::Category, KLFLibEntry::DateTime, KLFLibEntry::Latex, KLFLibEntry::PreviewSize, and KLFLibEntry::Tags.
Referenced by KLFLibModel::data(), fetchMore(), and rebuildCache().
KLFLibModelCache::NodeId KLFLibModelCache::nextNode | ( | NodeId | n | ) |
Walks the whole tree returning all the nodes one after the other, in the following order: if n
has children, first child is returned; otherwise next sibling is returned.
This function returns all nodes in the order they would be displayed in a tree view.
Returns NULL
after last node. Returns first node in tree if NULL
is given as paremeter.
Definition at line 1274 of file klflibview.cpp.
References KLFLibModelCache::Node::allChildrenFetched, canFetchMore(), KLFLibModelCache::Node::children, fetchMore(), getNode(), getNodeRow(), KLFLibModelCache::Node::parent, KLFLibModelCache::NodeId::rootNode(), and KLFLibModelCache::NodeId::valid().
Referenced by ensureNotMinimalist(), KLFLibModel::searchFindNext(), and KLFLibModel::walkNextIndex().
QString KLFLibModelCache::nodeValue | ( | NodeId | node, |
int | propId = KLFLibEntry::Latex |
||
) |
If node is a category label, then propId
is ignored.
Definition at line 1189 of file klflibview.cpp.
References KLFLibModelCache::CategoryLabelNode::categoryLabel, CategoryLabelKind, KLFLibModelCache::EntryNode::entry, EntryKind, KLFLibModel::entrySorter(), KLFLibEntrySorter::entryValue(), getCategoryLabelNodeRef(), getEntryNodeRef(), KLFLibModelCache::NodeId::isRoot(), KLFLibModelCache::NodeId::kind, KLF_FUNC_NAME, pModel, and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModelCache::KLFLibModelSorter::operator()(), and searchNodeMatches().
KLFLibModelCache::NodeId KLFLibModelCache::prevNode | ( | NodeId | n | ) |
Same as nextNode() but the walk is performed in the opposite direction.
This function returns all nodes in the inverse order they would be displayed in a tree view. In particular, it returns a parent node after having explored its children.
Definition at line 1317 of file klflibview.cpp.
References KLFLibModelCache::Node::children, getNode(), getNodeRow(), KLFLibModelCache::NodeId::isRoot(), lastNode(), KLFLibModelCache::Node::parent, KLFLibModelCache::NodeId::rootNode(), and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::searchFindNext(), and KLFLibModel::walkPrevIndex().
void KLFLibModelCache::rebuildCache | ( | ) |
Definition at line 424 of file klflibview.cpp.
References KLFLibModelCache::Node::allChildrenFetched, QList::append(), QList::begin(), cacheFindCategoryLabel(), KLFLibEntry::Category, KLFLibModelCache::CategoryLabelNode::categoryLabel, KLFLibModel::CategoryTree, QAbstractItemModel::changePersistentIndexList(), QList::clear(), KLFLibResourceEngine::defaultSubResource(), KLFProgressReporter::doReportProgress(), QList::end(), KLFLibModelCache::EntryNode::entry, KLFLibResourceEngine::KLFLibEntryWithId::entry, KLFLibModelCache::EntryNode::entryid, KLFLibResourceEngine::QueryResult::entryWithIdList, KLFLibResourceEngine::QueryResult::FillEntryWithIdList, KLFLibModelCache::CategoryLabelNode::fullCategoryPath, fullDump(), KLFLibResourceEngine::KLFLibEntryWithId::id, QString::isEmpty(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, klfDbgT, klfFmtCC, KLFLibResourceEngine::Query::limit, KLFLibResourceEngine::Query::matchCondition, KLFLibModelCache::EntryNode::minimalist, minimalistEntryPropIds(), KLFLib::EntryMatchCondition::mkPropertyMatch(), KLFLibModel::operationStartReportingProgress(), KLFLibResourceEngine::Query::orderDirection, KLFLibResourceEngine::Query::orderPropId, QAbstractItemModel::persistentIndexList(), pModel, KLFLibResourceEngine::query(), KLFLibResourceEngine::queryValues(), QAbstractItemModel::reset(), QList::size(), QString::split(), QObject::tr(), treeInsertEntry(), and KLFLibResourceEngine::Query::wantedEntryProperties.
Referenced by updateData().
bool KLFLibModelCache::searchNodeMatches | ( | const NodeId & | nodeId, |
const QString & | searchString, | ||
Qt::CaseSensitivity | cs | ||
) |
returns TRUE if the node nodeId
matches the search query defined by searchString
and case-sensitivity cs
.
Definition at line 2272 of file klflibview.cpp.
References KLFLibEntry::Category, CategoryLabelKind, KLFLibModel::CategoryTree, KLFLibModelCache::NodeId::kind, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, KLFLibEntry::Latex, nodeValue(), pModel, and KLFLibEntry::Tags.
Referenced by KLFLibModel::searchFindNext().
|
inline |
Remembers the given sort parameters, but does NOT update anything.
Definition at line 318 of file klflibview_p.h.
Referenced by KLFLibModel::sort().
void KLFLibModelCache::sortCategory | ( | NodeId | category, |
KLFLibModelSorter * | sorter, | ||
bool | rootCall = true |
||
) |
Sort a category's children – DON'T USE—OBSOLETE, does not handle fetch-mores
Definition at line 1213 of file klflibview.cpp.
References QList::begin(), CategoryLabelKind, QList::end(), EntryKind, KLFLibModelCache::KLFLibModelSorter::entrySorter(), KLFLibModel::GroupSubCategories, KLFLibModelCache::NodeId::index, KLFLibModelCache::NodeId::kind, KLFLibEntrySorter::order(), pModel, KLFLibEntrySorter::propId(), and QList::size().
void KLFLibModelCache::treeInsertEntry | ( | const EntryNode & | e, |
bool | isRebuildingCache = false |
||
) |
if isRebuildingCache
is set, then items are just appended to the category childs (as they are inserted in the right order), and calls to cacheFindCategoryLabel will set newlyCreatedAllChildrenFetched
parameter to FALSE.
emits QAbstractItemModel-appropriate beginInsertRows()/endInsertRows() if isRebuildingCache
is FALSE. Those signals are also emitted (if isRebuildingCache
is false) when category labels are created to fit the node.
The entry-node e
must not be yet in the entry cache.
Definition at line 963 of file klflibview.cpp.
References QList::begin(), QAbstractItemModel::beginInsertRows(), cacheFindCategoryLabel(), canFetchMore(), KLFLibEntry::category(), CategoryLabelKind, KLFLibModel::CategoryTree, KLFLibModelCache::Node::children, createIndexFromId(), KLFLibModel::displayType(), QList::end(), QAbstractItemModel::endInsertRows(), KLFLibModelCache::EntryNode::entry, EntryKind, fetchMore(), KLFLibModelCache::CategoryLabelNode::fullCategoryPath, getCategoryLabelNodeRef(), getNodeRef(), KLFLibModel::GroupSubCategories, KLFLibModelCache::NodeId::index, QList::insert(), KLFLibModelCache::NodeCache< N >::insertNewNode(), KLFLibModelCache::NodeId::kind, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibModel::LinearList, pModel, QList::size(), and QString::split().
Referenced by rebuildCache(), and updateData().
KLFLibModelCache::EntryNode KLFLibModelCache::treeTakeEntry | ( | const NodeId & | e, |
bool | notifyQtApi = true |
||
) |
emits QAbstractItemModel-appropriate signals and updates indexes if notifyQtApi
is true
This function sets the entryId of the removed entry to -1 so that it cannot be re-found in a future search.
Definition at line 1048 of file klflibview.cpp.
References QAbstractItemModel::beginRemoveRows(), CategoryLabelKind, KLFLibModelCache::Node::children, createIndexFromId(), QAbstractItemModel::endRemoveRows(), EntryKind, getEntryNodeRef(), getNode(), getNodeRef(), KLFLibModelCache::NodeId::index, QList::indexOf(), KLFLibModelCache::NodeId::kind, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibModelCache::Node::parent, pModel, KLFLibModelCache::NodeId::rootNode(), KLFLibModelCache::NodeCache< N >::unlinkNode(), and KLFLibModelCache::NodeId::valid().
Referenced by updateData().
void KLFLibModelCache::updateData | ( | const QList< KLFLib::entryId > & | entryIdList, |
int | modifyType | ||
) |
Definition at line 840 of file klflibview.cpp.
References KLFLibEntry::category(), KLFLibModel::CategoryTree, KLFLibResourceEngine::ChangeData, createIndexFromId(), QAbstractItemModel::dataChanged(), KLFLibResourceEngine::DeleteData, KLFLibResourceEngine::entries(), KLFLibModelCache::EntryNode::entry, KLFLibModelCache::EntryNode::entryid, findEntryId(), fullDump(), KLFLibModelCache::NodeId::index, KLFLibResourceEngine::InsertData, KLFLibModelCache::NodeId::kind, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibModelCache::EntryNode::minimalist, KLFLibModel::operationStartReportingProgress(), pModel, rebuildCache(), QList::size(), QObject::tr(), treeInsertEntry(), treeTakeEntry(), KLFLibResourceEngine::UnknownModification, and KLFLibModelCache::NodeId::valid().
Referenced by KLFLibModel::updateData().
EntryNode KLFLibModelCache::pInvalidEntryNode |
Definition at line 208 of file klflibview_p.h.
Referenced by getNodeRef().
KLFLibModel* KLFLibModelCache::pModel |
Definition at line 223 of file klflibview_p.h.
Referenced by cacheFindCategoryLabel(), createIndexFromId(), ensureNotMinimalist(), fetchMore(), nodeValue(), rebuildCache(), searchNodeMatches(), sortCategory(), treeInsertEntry(), treeTakeEntry(), and updateData().
|
static |
Definition at line 86 of file klflibview_p.h.
Referenced by KLFLibModelCache::NodeId::fromUID().
|
static |
Definition at line 87 of file klflibview_p.h.
|
static |
Definition at line 85 of file klflibview_p.h.
Referenced by KLFLibModelCache::NodeId::fromUID().
|
static |
Definition at line 84 of file klflibview_p.h.
Referenced by KLFLibModelCache::NodeId::fromUID(), and KLFLibModelCache::NodeId::universalId().