MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / loadGameSettingsJSON

Method loadGameSettingsJSON

pcsx2-qt/Debugger/DebuggerSettingsManager.cpp:17–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15const QString DebuggerSettingsManager::settingsFileVersion = "0.01";
16
17QJsonObject 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
39void DebuggerSettingsManager::writeJSONToPath(std::string path, QJsonDocument jsonDocument)
40{

Callers

nothing calls this directly

Calls 3

openMethod · 0.45
WriteLnFmtMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected