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

Pretty-print Aron JSON data in clipboard

Also fix a code style issue.
parent cc0d2fe5
No related branches found
No related tags found
1 merge request!200Resolve "ArMem Viewer: Export data to JSON via context menu"
......@@ -325,10 +325,11 @@ namespace armarx::armem::gui::instance
}
}
}
if (const std::optional<aron::Path> path = getElementPath(item))
const std::optional<aron::Path> elementPath = getElementPath(item);
if (elementPath)
{
menu.addAction(makeActionCopyDataToClipboard(path.value()));
menu.addAction(makeActionCopyDataToClipboard(elementPath.value()));
}
if (menu.actions().size() > 0)
......@@ -431,7 +432,7 @@ namespace armarx::armem::gui::instance
nlohmann::json json =
aron::converter::AronNlohmannJSONConverter::ConvertToNlohmannJSON(element);
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(QString::fromStdString(json.dump()));
clipboard->setText(QString::fromStdString(json.dump(2)));
QApplication::processEvents();
}
catch (const aron::error::AronException& e)
......
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