MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / saveJsonFile

Function saveJsonFile

launcher/minecraft/ProfileUtils.cpp:143–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool saveJsonFile(const QJsonDocument& doc, const QString& filename)
144{
145 auto data = doc.toJson();
146 QSaveFile jsonFile(filename);
147 if (!jsonFile.open(QIODevice::WriteOnly)) {
148 jsonFile.cancelWriting();
149 qWarning() << "Couldn't open" << filename << "for writing";
150 return false;
151 }
152 jsonFile.write(data);
153 if (!jsonFile.commit()) {
154 qWarning() << "Couldn't save" << filename;
155 return false;
156 }
157 return true;
158}
159
160void removeLwjglFromPatch(VersionFilePtr patch)
161{

Callers 1

loadComponentFunction · 0.85

Calls 3

toJsonMethod · 0.80
openMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected