| 92 | static const int currentComponentsFileVersion = 1; |
| 93 | |
| 94 | static QJsonObject componentToJsonV1(ComponentPtr component) |
| 95 | { |
| 96 | QJsonObject obj; |
| 97 | // critical |
| 98 | obj.insert("uid", component->m_uid); |
| 99 | if (!component->m_version.isEmpty()) { |
| 100 | obj.insert("version", component->m_version); |
| 101 | } |
| 102 | if (component->m_dependencyOnly) { |
| 103 | obj.insert("dependencyOnly", true); |
| 104 | } |
| 105 | if (component->m_important) { |
| 106 | obj.insert("important", true); |
| 107 | } |
| 108 | if (component->m_disabled) { |
| 109 | obj.insert("disabled", true); |
| 110 | } |
| 111 | |
| 112 | // cached |
| 113 | if (!component->m_cachedVersion.isEmpty()) { |
| 114 | obj.insert("cachedVersion", component->m_cachedVersion); |
| 115 | } |
| 116 | if (!component->m_cachedName.isEmpty()) { |
| 117 | obj.insert("cachedName", component->m_cachedName); |
| 118 | } |
| 119 | Meta::serializeRequires(obj, &component->m_cachedRequires, "cachedRequires"); |
| 120 | Meta::serializeRequires(obj, &component->m_cachedConflicts, "cachedConflicts"); |
| 121 | if (component->m_cachedVolatile) { |
| 122 | obj.insert("cachedVolatile", true); |
| 123 | } |
| 124 | return obj; |
| 125 | } |
| 126 | |
| 127 | static ComponentPtr componentFromJsonV1(PackProfile* parent, const QString& componentJsonPattern, const QJsonObject& obj) |
| 128 | { |
no test coverage detected