MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / rowCount

Method rowCount

App/Client/Favorite/FavoriteModel.cpp:66–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66int CFavoriteModel::rowCount(const QModelIndex &parent) const
67{
68 if(!m_pDatabase) return 0;
69 tree* item = nullptr;
70 if (parent.isValid()) {
71 if(parent.column() != 0) return 0;
72 item = (tree*)parent.internalPointer();
73 } else {
74 item = m_pRoot;
75 }
76
77 if(!item)
78 return 0;
79 if(item->item.isFavorite()) return 0;
80 if(item->children.size())
81 return item->children.size();
82 return m_pDatabase->GetCount(item->item.id);
83}
84
85int CFavoriteModel::columnCount(const QModelIndex &parent) const
86{

Callers

nothing calls this directly

Calls 3

isValidMethod · 0.80
isFavoriteMethod · 0.80
GetCountMethod · 0.80

Tested by

no test coverage detected