| 64 | } |
| 65 | |
| 66 | int 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 | |
| 85 | int CFavoriteModel::columnCount(const QModelIndex &parent) const |
| 86 | { |
nothing calls this directly
no test coverage detected