| 88 | } |
| 89 | |
| 90 | bool CFavoriteModel::canFetchMore(const QModelIndex &parent) const |
| 91 | { |
| 92 | //qDebug(log) << "canFatchMore:" << parent; |
| 93 | if(!m_pDatabase) return false; |
| 94 | int parentId = 0; |
| 95 | if (parent.isValid()) { |
| 96 | if(0 != parent.column()) return false; |
| 97 | tree* parentItem = static_cast<tree*>(parent.internalPointer()); |
| 98 | if(!parentItem) |
| 99 | return false; |
| 100 | if(parentItem->item.isFavorite()) |
| 101 | return false; |
| 102 | parentId = parentItem->item.id; |
| 103 | if(parentItem->children.isEmpty()) |
| 104 | return m_pDatabase->GetCount(parentId) > 0; |
| 105 | else |
| 106 | return false; |
| 107 | } |
| 108 | return true; |
| 109 | } |
| 110 | |
| 111 | void CFavoriteModel::fetchMore(const QModelIndex &parent) |
| 112 | { |
nothing calls this directly
no test coverage detected