on xenial help sign in
Added a role for accessing progress-source property of categories.

Approved by PS Jenkins bot, Michał Sawicz.

commit74c685c741df77892f1992d37ad24b651a098168 authorPawel Stolowski <pawel.stolowski@canonical.com> dateWed 21 Aug 2013, 16:33 (13 years ago) parent5d43ac03c01aab
3 files changed+8−1
debian/control+1−1 plugins/Unity/categories.cpp+6 plugins/Unity/categories.h+1
debian/control+1−1
@@ -20,7 +20,7 @@ Build-Depends: cmake,
2020 libsigc++-2.0-dev,
2121 libunity-api-dev (>= 7.80.3),
2222 libunity-core-6.0-dev (<< 7.80),
23− libunity-dev (>= 7.0.3),
23+ libunity-dev (>= 7.0.12),
2424 libunity-scopes-json-def-phone,
2525 libupstart-dev,
2626 libusermetricsoutput1-dev,
plugins/Unity/categories.cpp+6
@@ -39,6 +39,7 @@ Categories::Categories(QObject* parent)
3939 m_roles[Categories::RoleIcon] = "icon";
4040 m_roles[Categories::RoleRenderer] = "renderer";
4141 m_roles[Categories::RoleContentType] = "contentType";
42+ m_roles[Categories::RoleProgressSource] = "progressSource";
4243 m_roles[Categories::RoleHints] = "hints";
4344 m_roles[Categories::RoleResults] = "results";
4445 m_roles[Categories::RoleCount] = "count";
@@ -198,6 +199,11 @@ Categories::data(const QModelIndex& index, int role) const
198199 auto hints = DeeListModel::data(index, CategoryColumn::HINTS).toHash();
199200 return hints.contains("content-type") ? hints["content-type"] : QVariant(QString("default"));
200201 }
202+ case RoleProgressSource:
203+ {
204+ auto hints = DeeListModel::data(index, CategoryColumn::HINTS).toHash();
205+ return hints.contains("progress-source") ? hints["progress-source"] : QVariant();
206+ }
201207 case RoleHints:
202208 return DeeListModel::data(index, CategoryColumn::HINTS);
203209 case RoleResults:
plugins/Unity/categories.h+1
@@ -47,6 +47,7 @@ public:
4747 RoleIcon,
4848 RoleRenderer,
4949 RoleContentType,
50+ RoleProgressSource,
5051 RoleHints,
5152 RoleResults,
5253 RoleCount,