| 272 | } |
| 273 | |
| 274 | QJsonObject FlatpakRuntime::config(const KDevelop::Path& path) |
| 275 | { |
| 276 | QFile f(path.toLocalFile()); |
| 277 | if (!f.open(QIODevice::ReadOnly)) { |
| 278 | qCWarning(FLATPAK) << "couldn't open" << path; |
| 279 | return {}; |
| 280 | } |
| 281 | |
| 282 | QJsonParseError error; |
| 283 | auto doc = QJsonDocument::fromJson(f.readAll(), &error); |
| 284 | if (error.error) { |
| 285 | qCWarning(FLATPAK) << "couldn't parse" << path << error.errorString(); |
| 286 | return {}; |
| 287 | } |
| 288 | |
| 289 | return doc.object(); |
| 290 | } |
| 291 | |
| 292 | QJsonObject FlatpakRuntime::config() const |
| 293 | { |