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

Method saveChanges

source/json_tool/editor_gui.cpp:102–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102bool 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
116void JsonEditor::displayCurrentFile() {
117 String file = m_files.get(m_fileIndex);

Callers

nothing calls this directly

Calls 4

textMethod · 0.80
toJsonMethod · 0.45
getMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected