| 413 | } |
| 414 | |
| 415 | int CodeCompletionModel::rowCount(const QModelIndex& parent) const |
| 416 | { |
| 417 | if (parent.isValid()) { |
| 418 | auto* element = static_cast<CompletionTreeElement*>(parent.internalPointer()); |
| 419 | |
| 420 | CompletionTreeNode* node = element->asNode(); |
| 421 | |
| 422 | if (!node) |
| 423 | return 0; |
| 424 | |
| 425 | return node->children.count(); |
| 426 | } else { |
| 427 | return m_completionItems.count(); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | QString CodeCompletionModel::filterString(KTextEditor::View* view, const KTextEditor::Range& range, |
| 432 | const KTextEditor::Cursor& position) |