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