Commit c19795a1 authored by John Tourtellott's avatar John Tourtellott Committed by Kitware Robot

Merge topic 'qt-resource-manager-checks'

d0b4d9f0 Add checks for resource manager
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Bob Obara's avatarBob Obara <bob.obara@kitware.com>
Merge-request: !1522
parents ca2e364c d0b4d9f0
Pipeline #134613 running with stage
......@@ -242,6 +242,11 @@ std::set<smtk::resource::PersistentObjectPtr> qtAssociationWidget::associatableO
{
// Iterate over the acceptable entries
auto resManager = this->Internals->view->uiManager()->resourceManager();
if (resManager == nullptr)
{
return result;
}
decltype(assocMap.equal_range("")) range;
for (auto i = assocMap.begin(); i != assocMap.end(); i = range.second)
{
......@@ -278,7 +283,7 @@ smtk::resource::PersistentObjectPtr qtAssociationWidget::object(QListWidgetItem*
{
auto resManager = this->Internals->view->uiManager()->resourceManager();
smtk::resource::PersistentObjectPtr object;
if (item == nullptr)
if ((resManager == nullptr) || (item == nullptr))
{
smtk::resource::PersistentObjectPtr obj;
return obj;
......
......@@ -364,6 +364,11 @@ std::set<smtk::resource::PersistentObjectPtr> qtModelEntityAttributeView::associ
{
// Iterate over the acceptable entries
auto resManager = this->uiManager()->resourceManager();
if (resManager == nullptr)
{
std::cerr << "qtModelEntityAttributeView: Could not find Resource Manager!\n";
return result;
}
// Ask the resource manager to get all appropriate resources
resources = resManager->find(smtk::model::Resource::type_name);
// Need to process all of these resources
......@@ -381,7 +386,7 @@ smtk::resource::PersistentObjectPtr qtModelEntityAttributeView::object(QTableWid
{
auto resManager = this->uiManager()->resourceManager();
smtk::resource::PersistentObjectPtr object;
if (item == nullptr)
if ((resManager == nullptr) || (item == nullptr))
{
smtk::resource::PersistentObjectPtr obj;
return obj;
......@@ -504,6 +509,11 @@ void qtModelEntityAttributeView::cellChanged(int row, int column)
auto attRes = this->uiManager()->attResource();
auto resManager = this->uiManager()->resourceManager();
if (resManager == nullptr)
{
return;
}
QList<smtk::attribute::DefinitionPtr> currentDefs =
this->Internals->getCurrentDefs(this->uiManager());
// Get the component of the item
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment