mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Fix performance counters without a category
In the performance counter selection dialog, show counters without a category at root of tree, rather than as children of a nameless "" category.
This commit is contained in:
committed by
Baldur Karlsson
parent
9bebaaed8b
commit
e5bb692caf
@@ -303,23 +303,31 @@ void PerformanceCounterSelection::SetCounters(const QVector<CounterDescription>
|
||||
|
||||
RDTreeWidgetItem *categoryItem = NULL;
|
||||
|
||||
const rdcstr category = desc.category;
|
||||
auto categoryIterator = categories.find(category);
|
||||
|
||||
if(categoryIterator == categories.end())
|
||||
if(desc.category.empty())
|
||||
{
|
||||
RDTreeWidgetItem *item = new RDTreeWidgetItem();
|
||||
item->setText(0, desc.category);
|
||||
item->setCheckState(0, Qt::Unchecked);
|
||||
item->setData(0, PreviousCheckStateRole, Qt::Unchecked);
|
||||
currentRoot->addChild(item);
|
||||
|
||||
categories[category] = item;
|
||||
categoryItem = item;
|
||||
// Show uncategorized counters at the root level
|
||||
categoryItem = currentRoot;
|
||||
}
|
||||
else
|
||||
{
|
||||
categoryItem = categoryIterator.value();
|
||||
const rdcstr category = desc.category;
|
||||
auto categoryIterator = categories.find(category);
|
||||
|
||||
if(categoryIterator == categories.end())
|
||||
{
|
||||
RDTreeWidgetItem *item = new RDTreeWidgetItem();
|
||||
item->setText(0, desc.category);
|
||||
item->setCheckState(0, Qt::Unchecked);
|
||||
item->setData(0, PreviousCheckStateRole, Qt::Unchecked);
|
||||
currentRoot->addChild(item);
|
||||
|
||||
categories[category] = item;
|
||||
categoryItem = item;
|
||||
}
|
||||
else
|
||||
{
|
||||
categoryItem = categoryIterator.value();
|
||||
}
|
||||
}
|
||||
|
||||
RDTreeWidgetItem *counterItem = new RDTreeWidgetItem();
|
||||
|
||||
Reference in New Issue
Block a user