on xenial help sign in
Remove unneeded role.
cc4e572Albert Astals
plugins/Unity/categories.cpp−3
@@ -43,7 +43,6 @@ Categories::Categories(QObject* parent)
43 m_roles[Categories::RoleHints] = "hints";
43 m_roles[Categories::RoleHints] = "hints";
44 m_roles[Categories::RoleResults] = "results";
44 m_roles[Categories::RoleResults] = "results";
45 m_roles[Categories::RoleCount] = "count";
45 m_roles[Categories::RoleCount] = "count";
46− m_roles[Categories::RoleCategoryIndex] = "categoryIndex";
47
46
48 // TODO This should not be needed but accumulatting the count changes
47 // TODO This should not be needed but accumulatting the count changes
49 // makes the visualization more stable and also makes crashes on fast
48 // makes the visualization more stable and also makes crashes on fast
@@ -222,8 +221,6 @@ Categories::data(const QModelIndex& index, int role) const
222 return QVariant::fromValue(m_overriddenCategories[id]->rowCount());
221 return QVariant::fromValue(m_overriddenCategories[id]->rowCount());
223 }
222 }
224 return QVariant::fromValue(getResults(index.row())->rowCount());
223 return QVariant::fromValue(getResults(index.row())->rowCount());
225− case RoleCategoryIndex:
226− return QVariant::fromValue(index.row());
227 default:
224 default:
228 return QVariant();
225 return QVariant();
229 }
226 }
plugins/Unity/categories.h+1−2
@@ -50,8 +50,7 @@ public:
50 RoleProgressSource,
50 RoleProgressSource,
51 RoleHints,
51 RoleHints,
52 RoleResults,
52 RoleResults,
53− RoleCount,
53+ RoleCount
54− RoleCategoryIndex
55 };
54 };
56
55
57 Q_INVOKABLE void overrideResults(const QString& categoryId, QAbstractItemModel* model);
56 Q_INVOKABLE void overrideResults(const QString& categoryId, QAbstractItemModel* model);
tests/mocks/Unity/fake_categories.cpp−3
@@ -36,7 +36,6 @@ Categories::Categories(QObject* parent)
36 m_roles[Categories::RoleHints] = "hints";
36 m_roles[Categories::RoleHints] = "hints";
37 m_roles[Categories::RoleResults] = "results";
37 m_roles[Categories::RoleResults] = "results";
38 m_roles[Categories::RoleCount] = "count";
38 m_roles[Categories::RoleCount] = "count";
39− m_roles[Categories::RoleCategoryIndex] = "categoryIndex";
40
39
41 // TODO This should not be needed but accumulatting the count changes
40 // TODO This should not be needed but accumulatting the count changes
42 // makes the visualization more stable and also makes crashes on fast
41 // makes the visualization more stable and also makes crashes on fast
@@ -173,8 +172,6 @@ Categories::data(const QModelIndex& index, int role) const
173 return QVariant::fromValue(getFilter(index.row()));
172 return QVariant::fromValue(getFilter(index.row()));
174 case RoleCount:
173 case RoleCount:
175 return QVariant::fromValue(getFilter(index.row())->rowCount());
174 return QVariant::fromValue(getFilter(index.row())->rowCount());
176− case RoleCategoryIndex:
177− return QVariant::fromValue(index.row());
178 default:
175 default:
179 return QVariant();
176 return QVariant();
180 }
177 }
tests/mocks/Unity/fake_categories.h+1−2
@@ -41,8 +41,7 @@ public:
41 RoleContentType,
41 RoleContentType,
42 RoleHints,
42 RoleHints,
43 RoleResults,
43 RoleResults,
44− RoleCount,
44+ RoleCount
45− RoleCategoryIndex
46 };
45 };
47
46
48 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
47 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;