MCPcopy Create free account
hub / github.com/YACReader/yacreader / rowCount

Method rowCount

YACReaderLibrary/db/reading_list_model.cpp:19–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19int ReadingListModel::rowCount(const QModelIndex &parent) const
20{
21 if (!parent.isValid()) // TOP
22 {
23 int separatorsCount = 2; // labels.isEmpty()?1:2;
24 return specialLists.count() + labels.count() + rootItem->childCount() + separatorsCount;
25 } else {
26 auto item = static_cast<ListItem *>(parent.internalPointer());
27
28 if (typeid(*item) == typeid(ReadingListItem)) {
29 auto item = static_cast<ReadingListItem *>(parent.internalPointer());
30 return item->childCount();
31 }
32 }
33
34 return 0;
35}
36
37int ReadingListModel::columnCount(const QModelIndex &parent) const
38{

Callers

nothing calls this directly

Calls 2

isValidMethod · 0.45
childCountMethod · 0.45

Tested by

no test coverage detected