| 100 | } |
| 101 | |
| 102 | bool JsonEditor::saveChanges() { |
| 103 | try { |
| 104 | FormattedJson newValue = m_editFormat->toJson(m_valueEditor->text().toStdString()); |
| 105 | m_currentJson = addOrSet(false, m_path, m_currentJson, m_options.insertLocation, newValue); |
| 106 | String repr = reprWithLineEnding(m_currentJson); |
| 107 | File::writeFile(repr, m_files.get(m_fileIndex)); |
| 108 | return true; |
| 109 | |
| 110 | } catch (StarException const& e) { |
| 111 | m_errorDialog->showMessage(e.what()); |
| 112 | return false; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | void JsonEditor::displayCurrentFile() { |
| 117 | String file = m_files.get(m_fileIndex); |