MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / saveJsonFile

Function saveJsonFile

launcher/minecraft/ProfileUtils.cpp:160–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160bool saveJsonFile(const QJsonDocument doc, const QString & filename)
161{
162 auto data = doc.toJson();
163 QSaveFile jsonFile(filename);
164 if(!jsonFile.open(QIODevice::WriteOnly))
165 {
166 jsonFile.cancelWriting();
167 qWarning() << "Couldn't open" << filename << "for writing";
168 return false;
169 }
170 jsonFile.write(data);
171 if(!jsonFile.commit())
172 {
173 qWarning() << "Couldn't save" << filename;
174 return false;
175 }
176 return true;
177}
178
179void removeLwjglFromPatch(VersionFilePtr patch)
180{

Callers 1

loadComponentFunction · 0.85

Calls 3

toJsonMethod · 0.80
openMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected