Version
| 49 | |
| 50 | // Version |
| 51 | static Version::Ptr parseCommonVersion(const QString& uid, const QJsonObject& obj) |
| 52 | { |
| 53 | Version::Ptr version = std::make_shared<Version>(uid, requireString(obj, "version")); |
| 54 | version->setTime(QDateTime::fromString(requireString(obj, "releaseTime"), Qt::ISODate).toMSecsSinceEpoch() / 1000); |
| 55 | version->setType(ensureString(obj, "type", QString())); |
| 56 | version->setRecommended(ensureBoolean(obj, QString("recommended"), false)); |
| 57 | version->setVolatile(ensureBoolean(obj, QString("volatile"), false)); |
| 58 | RequireSet reqs, conflicts; |
| 59 | parseRequires(obj, &reqs, "requires"); |
| 60 | parseRequires(obj, &conflicts, "conflicts"); |
| 61 | version->setRequires(reqs, conflicts); |
| 62 | if (auto sha256 = ensureString(obj, "sha256", QString()); !sha256.isEmpty()) { |
| 63 | version->setSha256(sha256); |
| 64 | } |
| 65 | return version; |
| 66 | } |
| 67 | |
| 68 | static Version::Ptr parseVersionInternal(const QJsonObject& obj) |
| 69 | { |
no test coverage detected