MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / migrateQByteArrayToBase64

Function migrateQByteArrayToBase64

launcher/settings/INIFile.cpp:153–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153QVariant migrateQByteArrayToBase64(QString key, QVariant value)
154{
155 static const QStringList otherByteArrays = { "MainWindowState", "MainWindowGeometry", "ConsoleWindowState",
156 "ConsoleWindowGeometry", "PagedGeometry", "NewInstanceGeometry",
157 "ModDownloadGeometry", "RPDownloadGeometry", "TPDownloadGeometry",
158 "ShaderDownloadGeometry" };
159 if (key.startsWith("WideBarVisibility_") || (key.startsWith("UI/") && key.endsWith("_Page/Columns"))) {
160 return QString::fromUtf8(value.toByteArray().toBase64());
161 }
162 if (otherByteArrays.contains(key)) {
163 return QString::fromUtf8(value.toByteArray());
164 }
165 if (key == "linkedInstances") {
166 return Json::fromStringList(value.toStringList());
167 }
168 if (key == "Env") {
169 return Json::fromMap(value.toMap());
170 }
171 return value;
172}
173
174bool INIFile::loadFile(QString fileName)
175{

Callers 1

loadFileMethod · 0.85

Calls 4

fromStringListFunction · 0.85
fromMapFunction · 0.85
toStringListMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected