| 381 | } |
| 382 | |
| 383 | bool ConfigParser::loadFromFile(const QString& confFile) { |
| 384 | QFile file(confFile); |
| 385 | QString confFilePath = QFileInfo(confFile).absolutePath(); |
| 386 | |
| 387 | if (file.open(QIODevice::ReadOnly)) { |
| 388 | auto doc = QJsonDocument::fromJson(file.readAll()); |
| 389 | |
| 390 | if (!doc.isObject()) { |
| 391 | return false; |
| 392 | } |
| 393 | |
| 394 | auto obj = doc.object(); |
| 395 | const auto keys = obj.keys(); |
| 396 | for (const auto &key: keys) { |
| 397 | readKey(key, obj, confFilePath); |
| 398 | } |
| 399 | |
| 400 | file.close(); |
| 401 | |
| 402 | return true; |
| 403 | } |
| 404 | |
| 405 | return false; |
| 406 | } |
| 407 | |
| 408 | bool ConfigParser::initDistroStruct() { |
| 409 |
nothing calls this directly
no outgoing calls
no test coverage detected