on xenial help sign in
Use the new string categoryIds in custom video and music scope views. Fixes: https://bugs.launchpad.net/bugs/1199322.

Approved by PS Jenkins bot, Michal Hruby.

commit2186b2fb4fa04be9e6e63b97516635fa1ae94e29 authorMichał Sawicz <michal.sawicz@canonical.com> dateSat 27 Jul 2013, 02:07 (13 years ago) parenta809721bcc6045
5 files changed+8−9
Dash/DashApps.qml+1−1 Dash/DashMusic.qml+2−2 Dash/DashVideos.qml+2−3 plugins/Unity/categories.cpp+2−2 plugins/Unity/categories.h+1−1
Dash/DashApps.qml+1−1
@@ -87,7 +87,7 @@ ScopeView {
8787 model: scopeView.scope.categories
8888
8989 delegate: Item {
90− Component.onCompleted: if (id == "installed") scopeView.installedModel = Qt.binding(function() { return model.results; });
90+ Component.onCompleted: if (categoryId == "installed") scopeView.installedModel = Qt.binding(function() { return model.results; });
9191 }
9292 }
9393
Dash/DashMusic.qml+2−2
@@ -52,7 +52,7 @@ ScopeView {
5252
5353 function getRenderer(categoryId) {
5454 switch (categoryId) {
55− case 1: return "Music/MusicCarousel.qml"
55+ case "featured": return "Music/MusicCarousel.qml"
5656 default: return "Music/MusicFilterGrid.qml"
5757 }
5858 }
@@ -69,7 +69,7 @@ ScopeView {
6969 id: base
7070 highlightWhenPressed: false
7171
72− property int categoryId: id
72+ property string categoryId: model.categoryId
7373
7474 Loader {
7575 anchors { top: parent.top; left: parent.left; right: parent.right }
Dash/DashVideos.qml+2−3
@@ -53,7 +53,7 @@ ScopeView {
5353
5454 function getRenderer(categoryId) {
5555 switch (categoryId) {
56− case 1: return "Video/VideosCarousel.qml"
56+ case "featured": return "Video/VideosCarousel.qml"
5757 default: return "Video/VideosFilterGrid.qml"
5858 }
5959 }
@@ -102,8 +102,7 @@ ScopeView {
102102 delegate: ListItems.Base {
103103 id: base
104104 highlightWhenPressed: false
105− property int categoryIndex: index
106− property int categoryId: id
105+ property string categoryId: model.categoryId
107106
108107 Loader {
109108 id: loader
plugins/Unity/categories.cpp+2−2
@@ -34,7 +34,7 @@ enum CategoryColumn {
3434Categories::Categories(QObject* parent)
3535 : DeeListModel(parent)
3636{
37− m_roles[Categories::RoleId] = "id";
37+ m_roles[Categories::RoleCategoryId] = "categoryId";
3838 m_roles[Categories::RoleName] = "name";
3939 m_roles[Categories::RoleIcon] = "icon";
4040 m_roles[Categories::RoleRenderer] = "renderer";
@@ -131,7 +131,7 @@ Categories::data(const QModelIndex& index, int role) const
131131 }
132132
133133 switch (role) {
134− case RoleId:
134+ case RoleCategoryId:
135135 return DeeListModel::data(index, CategoryColumn::ID);
136136 case RoleName:
137137 return DeeListModel::data(index, CategoryColumn::DISPLAY_NAME);
plugins/Unity/categories.h+1−1
@@ -42,7 +42,7 @@ public:
4242 explicit Categories(QObject* parent = 0);
4343
4444 enum Roles {
45− RoleId,
45+ RoleCategoryId,
4646 RoleName,
4747 RoleIcon,
4848 RoleRenderer,