| 15 | const QString DebuggerSettingsManager::settingsFileVersion = "0.01"; |
| 16 | |
| 17 | QJsonObject DebuggerSettingsManager::loadGameSettingsJSON() |
| 18 | { |
| 19 | std::string path = VMManager::GetDebuggerSettingsFilePathForCurrentGame(); |
| 20 | QFile file(QString::fromStdString(path)); |
| 21 | if (!file.open(QIODevice::ReadOnly)) |
| 22 | { |
| 23 | Console.WriteLnFmt("Debugger Settings Manager: No Debugger Settings file found for game at: '{}'", path); |
| 24 | return QJsonObject(); |
| 25 | } |
| 26 | QByteArray fileContent = file.readAll(); |
| 27 | file.close(); |
| 28 | |
| 29 | const QJsonDocument jsonDoc(QJsonDocument::fromJson(fileContent)); |
| 30 | if (jsonDoc.isNull() || !jsonDoc.isObject()) |
| 31 | { |
| 32 | Console.WriteLnFmt("Debugger Settings Manager: Failed to load contents of settings file for file at: '{}'", path); |
| 33 | return QJsonObject(); |
| 34 | } |
| 35 | |
| 36 | return jsonDoc.object(); |
| 37 | } |
| 38 | |
| 39 | void DebuggerSettingsManager::writeJSONToPath(std::string path, QJsonDocument jsonDocument) |
| 40 | { |
nothing calls this directly
no test coverage detected