Skip to content
Snippets Groups Projects
Commit 99635aa0 authored by Philip Scherer's avatar Philip Scherer
Browse files

Allow easy JSON export to start on untyped data

Also fixes a segfault that occurred when right-clicking on an
InstanceView entry when "Use Type Information" was deactivated.
parent 90f62b13
No related branches found
No related tags found
1 merge request!221Resolve "Fix easy JSON export with untyped data"
......@@ -454,7 +454,20 @@ namespace armarx::armem::gui::instance
try
{
aron::data::VariantPtr element = currentInstance->data()->navigateAbsolute(path);
aron::type::VariantPtr elementType = currentAronType->navigateAbsolute(path);
aron::type::VariantPtr elementType = nullptr;
if (currentAronType)
{
// There doesn't seem to be a way to check whether the path exists
// without potentially throwing an exception.
try
{
elementType = currentAronType->navigateAbsolute(path);
}
catch (const aron::error::AronException& e)
{
// No type available, elementType remains nullptr.
}
}
return makeCopyActions(element, elementType);
}
catch (const aron::error::AronException& e)
......
......@@ -249,6 +249,9 @@ namespace armarx::armem::gui::instance
{
this->setRowTexts(item, key, data);
item->setData(columnKey, Qt::UserRole,
data ? instance::serializePath(data->getPath()) : QStringList());
if (auto cast = aron::data::Dict::DynamicCast(data))
{
DataTreeBuilder builder;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment