on xenial help sign in
Fix categories with attributes
980bb65Andrea Cimitan
tests/mocks/Unity/fake_categories.cpp+6−2
@@ -109,11 +109,13 @@ Categories::data(const QModelIndex& index, int role) const
109 }
109 }
110 case RoleComponents:
110 case RoleComponents:
111 {
111 {
112− QVariantMap map, artMap;
112+ QVariantMap map, artMap, attributeMap;
113 artMap["aspect-ratio"] = "1.0";
113 artMap["aspect-ratio"] = "1.0";
114 artMap["field"] = "art";
114 artMap["field"] = "art";
115 map["art"] = artMap;
115 map["art"] = artMap;
116 map["title"] = "HOLA";
116 map["title"] = "HOLA";
117+ attributeMap["field"] = "attribute";
118+ map["attributes"] = attributeMap;
117 return map;
119 return map;
118 }
120 }
119 case RoleHeaderLink:
121 case RoleHeaderLink:
@@ -156,7 +158,7 @@ Categories::data(const QModelIndex& index, int role) const
156 }
158 }
157 case RoleComponents:
159 case RoleComponents:
158 {
160 {
159− QVariantMap map, artMap;
161+ QVariantMap map, artMap, attributeMap;
160 if (index.row() % 2 != 0) {
162 if (index.row() % 2 != 0) {
161 artMap["aspect-ratio"] = QString("1.%1").arg(index.row());
163 artMap["aspect-ratio"] = QString("1.%1").arg(index.row());
162 } else {
164 } else {
@@ -166,6 +168,8 @@ Categories::data(const QModelIndex& index, int role) const
166 map["art"] = artMap;
168 map["art"] = artMap;
167 map["title"] = "HOLA";
169 map["title"] = "HOLA";
168 map["subtitle"] = "HOLA";
170 map["subtitle"] = "HOLA";
171+ attributeMap["field"] = "attribute";
172+ map["attributes"] = attributeMap;
169 return map;
173 return map;
170 }
174 }
171 case RoleHeaderLink:
175 case RoleHeaderLink: