@@ -32,9 +32,9 @@ ScopeView {
32 ListModel {
32 ListModel {
33 id: categoryListModel
33 id: categoryListModel
34 // specifies page's content categories, type of delegate and model used in each category
34 // specifies page's content categories, type of delegate and model used in each category
35− ListElement { category: "Frequent Apps"; component: "AppsGrid"; modelName: "AppsModel" }
35+ ListElement { category: "Frequent Apps"; component: "Apps/ApplicationsFilterGrid.qml"; modelName: "AppsModel" }
36− ListElement { category: "Recent Music"; component: "MusicGrid"; modelName: "MusicModel" }
36+ ListElement { category: "Recent Music"; component: "Music/MusicFilterGrid.qml"; modelName: "MusicModel" }
37− ListElement { category: "Videos Popular Online"; component: "VideosGrid"; modelName: "VideosModel" }
37+ ListElement { category: "Videos Popular Online"; component: "Video/VideosFilterGrid.qml"; modelName: "VideosModel" }
38 function getCategory(category1) {
38 function getCategory(category1) {
39 if (category1 === "Frequent Apps") {
39 if (category1 === "Frequent Apps") {
40 return i18n.tr("Frequent Apps");
40 return i18n.tr("Frequent Apps");
@@ -110,26 +110,6 @@ ScopeView {
110 "VideosModel": videosFilter,
110 "VideosModel": videosFilter,
113− /* Workaround for bug: https://bugreports.qt-project.org/browse/QTBUG-28403
114− When using Loader to load external QML file in the list deelgate, the ListView has
115− a bug where it can position the delegate content to overlap the section header
116− of the ListView - a workaround is to use sourceComponent of Loader instead */
118− id: applicationsFilterGrid
119− ApplicationsFilterGrid {
120− objectName: "dashHomeApplicationsGrid"
121− onClicked: shell.activateApplication(data);
125− Component { id: musicGrid; MusicFilterGrid {} }
126− Component { id: videosGrid; VideosFilterGrid {} }
127− property var componentModels: {
128− "AppsGrid": applicationsFilterGrid,
129− "MusicGrid": musicGrid,
130− "VideosGrid": videosGrid,
133 ScopeListView {
113 ScopeListView {
134 id: listView
114 id: listView
135 anchors.fill: parent
115 anchors.fill: parent
@@ -145,13 +125,13 @@ ScopeView {
147 anchors { top: parent.top; left: parent.left; right: parent.right }
127 anchors { top: parent.top; left: parent.left; right: parent.right }
148− sourceComponent: componentModels[component]
128+ source: component
149 onLoaded: {
129 onLoaded: {
150 item.model = categoryModels[modelName]
130 item.model = categoryModels[modelName]
152 //FIXME: workaround for lack of previews for videos in Home scope.
132 //FIXME: workaround for lack of previews for videos in Home scope.
153 //Need to connect to the clicked() signal here and act upon it here instead.
133 //Need to connect to the clicked() signal here and act upon it here instead.
154− if (component === "VideosGrid") {
134+ if (modelName === "VideosModel") {
155 function playVideo(index, data) {
135 function playVideo(index, data) {
156 if (data.fileUri) {
136 if (data.fileUri) {
157 shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', "/usr/share/demo-assets/videos/" + data.fileUri);
137 shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', "/usr/share/demo-assets/videos/" + data.fileUri);
@@ -159,6 +139,13 @@ ScopeView {
161 item.clicked.connect(playVideo);
141 item.clicked.connect(playVideo);
142+ } else if (modelName === "AppsModel") {
143+ function activateApplication(index, data) {
144+ shell.activateApplication(data);
147+ item.objectName = "dashHomeApplicationsGrid";
148+ item.clicked.connect(activateApplication);