| 88 | } |
| 89 | |
| 90 | void 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 | |
| 102 | bool JsonEditor::saveChanges() { |
| 103 | try { |