MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / updatePreview

Method updatePreview

source/json_tool/editor_gui.cpp:90–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void JsonEditor::updatePreview(QString const& valueStr) {
91 try {
92 FormattedJson newValue = m_editFormat->toJson(valueStr.toStdString());
93 FormattedJson preview = addOrSet(false, m_path, m_currentJson, m_options.insertLocation, newValue);
94 m_jsonDocument->setPlainText(preview.repr().utf8Ptr());
95
96 } catch (JsonException const&) {
97 } catch (JsonParsingException const&) {
98 // Don't update the preview if it's not valid Json.
99 }
100}
101
102bool JsonEditor::saveChanges() {
103 try {

Callers

nothing calls this directly

Calls 3

toJsonMethod · 0.45
utf8PtrMethod · 0.45
reprMethod · 0.45

Tested by

no test coverage detected