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

Function save

launcher/minecraft/gameoptions/GameOptions.cpp:42–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 return true;
41}
42bool save(const QString& path, std::vector<GameOptionItem> &mapping, int version)
43{
44 QSaveFile out(path);
45 if(!out.open(QIODevice::WriteOnly))
46 {
47 return false;
48 }
49 if(version != 0)
50 {
51 QString versionLine = QString("version:%1\n").arg(version);
52 out.write(versionLine.toUtf8());
53 }
54 auto iter = mapping.begin();
55 while (iter != mapping.end())
56 {
57 out.write(iter->key.toUtf8());
58 out.write(":");
59 out.write(iter->value.toUtf8());
60 out.write("\n");
61 iter++;
62 }
63 return out.commit();
64}
65}
66
67GameOptions::GameOptions(const QString& path):

Callers 2

~PrivatePackManagerMethod · 0.85
saveMethod · 0.85

Calls 5

QStringClass · 0.85
openMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected