on xenial help sign in
implement Filters::data
01a333bAlbert Astals Cid
tests/mocks/Unity/fake_filters.cpp+8
@@ -41,7 +41,15 @@ QVariant Filters::data(const QModelIndex &index, int role) const
41 if (row < 0 || row >= m_filters.count())
41 if (row < 0 || row >= m_filters.count())
42 return QVariant();
42 return QVariant();
43
43
44+ unity::shell::scopes::FilterBaseInterface *filter = m_filters[row];
45+
44 switch (role) {
46 switch (role) {
47+ case RoleFilterId:
48+ return filter->filterId();
49+ case RoleFilterType:
50+ return filter->filterType();
51+ case RoleFilter:
52+ return QVariant::fromValue<unity::shell::scopes::FilterBaseInterface *>(filter);
45 default:
53 default:
46 return QVariant();
54 return QVariant();
47 }
55 }