on xenial help sign in
Use the new string categoryIds in custom video and music scope views. Fixes: https://bugs.launchpad.net/bugs/1199322.
2186b2fMichał Sawicz
Dash/DashApps.qml+1−1
@@ -87,7 +87,7 @@ ScopeView {
87 model: scopeView.scope.categories
87 model: scopeView.scope.categories
88
88
89 delegate: Item {
89 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; });
91 }
91 }
92 }
92 }
93
93
Dash/DashMusic.qml+2−2
@@ -52,7 +52,7 @@ ScopeView {
52
52
53 function getRenderer(categoryId) {
53 function getRenderer(categoryId) {
54 switch (categoryId) {
54 switch (categoryId) {
55− case 1: return "Music/MusicCarousel.qml"
55+ case "featured": return "Music/MusicCarousel.qml"
56 default: return "Music/MusicFilterGrid.qml"
56 default: return "Music/MusicFilterGrid.qml"
57 }
57 }
58 }
58 }
@@ -69,7 +69,7 @@ ScopeView {
69 id: base
69 id: base
70 highlightWhenPressed: false
70 highlightWhenPressed: false
71
71
72− property int categoryId: id
72+ property string categoryId: model.categoryId
73
73
74 Loader {
74 Loader {
75 anchors { top: parent.top; left: parent.left; right: parent.right }
75 anchors { top: parent.top; left: parent.left; right: parent.right }
Dash/DashVideos.qml+2−3
@@ -53,7 +53,7 @@ ScopeView {
53
53
54 function getRenderer(categoryId) {
54 function getRenderer(categoryId) {
55 switch (categoryId) {
55 switch (categoryId) {
56− case 1: return "Video/VideosCarousel.qml"
56+ case "featured": return "Video/VideosCarousel.qml"
57 default: return "Video/VideosFilterGrid.qml"
57 default: return "Video/VideosFilterGrid.qml"
58 }
58 }
59 }
59 }
@@ -102,8 +102,7 @@ ScopeView {
102 delegate: ListItems.Base {
102 delegate: ListItems.Base {
103 id: base
103 id: base
104 highlightWhenPressed: false
104 highlightWhenPressed: false
105− property int categoryIndex: index
105+ property string categoryId: model.categoryId
106− property int categoryId: id
107
106
108 Loader {
107 Loader {
109 id: loader
108 id: loader
plugins/Unity/categories.cpp+2−2
@@ -34,7 +34,7 @@ enum CategoryColumn {
34Categories::Categories(QObject* parent)
34Categories::Categories(QObject* parent)
35 : DeeListModel(parent)
35 : DeeListModel(parent)
36{
36{
37− m_roles[Categories::RoleId] = "id";
37+ m_roles[Categories::RoleCategoryId] = "categoryId";
38 m_roles[Categories::RoleName] = "name";
38 m_roles[Categories::RoleName] = "name";
39 m_roles[Categories::RoleIcon] = "icon";
39 m_roles[Categories::RoleIcon] = "icon";
40 m_roles[Categories::RoleRenderer] = "renderer";
40 m_roles[Categories::RoleRenderer] = "renderer";
@@ -131,7 +131,7 @@ Categories::data(const QModelIndex& index, int role) const
131 }
131 }
132
132
133 switch (role) {
133 switch (role) {
134− case RoleId:
134+ case RoleCategoryId:
135 return DeeListModel::data(index, CategoryColumn::ID);
135 return DeeListModel::data(index, CategoryColumn::ID);
136 case RoleName:
136 case RoleName:
137 return DeeListModel::data(index, CategoryColumn::DISPLAY_NAME);
137 return DeeListModel::data(index, CategoryColumn::DISPLAY_NAME);
plugins/Unity/categories.h+1−1
@@ -42,7 +42,7 @@ public:
42 explicit Categories(QObject* parent = 0);
42 explicit Categories(QObject* parent = 0);
43
43
44 enum Roles {
44 enum Roles {
45− RoleId,
45+ RoleCategoryId,
46 RoleName,
46 RoleName,
47 RoleIcon,
47 RoleIcon,
48 RoleRenderer,
48 RoleRenderer,