Skip to content

Commit

Permalink
Show google test classes to outline
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed Jun 29, 2024
1 parent 99f0abf commit 45363a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/cppeditor/cppoutlinemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void OutlineModel::rebuild()
bool OutlineModel::isGenerated(const QModelIndex &sourceIndex) const
{
CPlusPlus::Symbol *symbol = symbolFromIndex(sourceIndex);
return symbol && symbol->isGenerated();
return symbol && symbol->isGenerated() && !m_overview.prettyName(symbol->name()).endsWith(u"_Test"_qs);
}

Utils::Link OutlineModel::linkFromIndex(const QModelIndex &sourceIndex) const
Expand Down Expand Up @@ -265,7 +265,9 @@ void OutlineModel::buildTree(SymbolItem *root, bool isRoot)
for (int row = 0; row < rows; ++row) {
Symbol *symbol = globalSymbolAt(row);
auto currentItem = new SymbolItem(symbol);
buildTree(currentItem, false);
if (!symbol->isGenerated()) {
buildTree(currentItem, false);
}
root->appendChild(currentItem);
}
root->prependChild(new SymbolItem); // account for no symbol item
Expand Down

0 comments on commit 45363a9

Please sign in to comment.