Resource Explorer view and model cleanup

This commit is contained in:
Dan Paulat 2022-09-22 00:09:23 -05:00
parent 06e33001f7
commit f47fab196e
4 changed files with 4 additions and 4 deletions

View file

@ -40,7 +40,7 @@ const std::shared_ptr<TreeItem> RadarProductModel::root_item() const
RadarProductModelImpl::RadarProductModelImpl(RadarProductModel* self) :
self_ {self},
rootItem_ {std::make_shared<TreeItem>(
std::vector<QVariant> {QObject::tr("Name"), QObject::tr("Info")})}
std::vector<QVariant> {QObject::tr("Product")})}
{
connect(
&manager::RadarProductManagerNotifier::Instance(),

View file

@ -132,7 +132,7 @@ QModelIndex TreeModel::parent(const QModelIndex& index) const
static_cast<const TreeItem*>(index.constInternalPointer());
const TreeItem* parentItem = childItem->parent_item();
if (parentItem == root_item().get())
if (parentItem == root_item().get() || parentItem == nullptr)
{
return QModelIndex();
}