@@ -52,42 +52,33 @@ ScopeView {
5252 FrequentlyUsedAppsModel { id: appsModel }
5353
5454 // FIXME this should be handled by the backends by populating the global search model
55− SortFilterProxyModel {
56− id: favouritesFilter
57− dynamicSortFilter: true
58− filterRole: 2
59− filterRegExp: /^0$/
60− }
55+ property var musicModel: null
56+ property var videosModel: null
6157
62− SortFilterProxyModel {
63− id: recentFilter
64− dynamicSortFilter: true
65− filterRole: 2
66− filterRegExp: /^2$/
67− }
58+ Repeater {
59+ id: musicRepeater
6860
69− SortFilterProxyModel {
70− id: musicFilter
71− dynamicSortFilter: true
72− filterRole: 2
73− filterRegExp: /^1$/
61+ delegate: Item {
62+ Component.onCompleted: if (index == 1) musicModel = Qt.binding(function() { return model.results; });
63+ }
7464 }
7565
76− SortFilterProxyModel {
77− id: videosFilter
78− dynamicSortFilter: true
79− filterRole: 2
80− filterRegExp: /^3$/
66+ Repeater {
67+ id: videosRepeater
68+
69+ delegate: Item {
70+ Component.onCompleted: if (index == 3) videosModel = Qt.binding(function() { return model.results; });
71+ }
8172 }
8273
8374 Component.onCompleted: {
8475 var scope = dashContent.scopes.get("mockmusicmaster.scope")
8576 if (scope) {
86− musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
77+ musicRepeater.model = dashContent.scopes.get("mockmusicmaster.scope").categories
8778 }
8879 scope = dashContent.scopes.get("mockvideosmaster.scope")
8980 if (scope) {
90− videosFilter.model = dashContent.scopes.get("mockvideosmaster.scope").results
81+ videosRepeater.model = dashContent.scopes.get("mockvideosmaster.scope").categories
9182 }
9283 }
9384
@@ -95,19 +86,17 @@ ScopeView {
9586 target: dashContent
9687 onScopeLoaded: switch (scopeId) {
9788 case "mockmusicmaster.scope":
98− musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
89+ musicRepeater.model = dashContent.scopes.get("mockmusicmaster.scope").categories
9990 break;
10091 case "mockvideosmaster.scope":
101− videosFilter.model = dashContent.scopes.get("mockvideosmaster.scope").results
92+ videosRepeater.model = dashContent.scopes.get("mockvideosmaster.scope").categories
10293 break;
10394 }
10495 }
10596
10697 property var categoryModels: {"AppsModel": appsModel,
107− "FavouriteModel": favouritesFilter,
108− "RecentModel": recentFilter,
109− "MusicModel": musicFilter,
110− "VideosModel": videosFilter,
98+ "MusicModel": musicModel,
99+ "VideosModel": videosModel,
111100 }
112101
113102 ScopeListView {
@@ -127,7 +116,7 @@ ScopeView {
127116 anchors { top: parent.top; left: parent.left; right: parent.right }
128117 source: component
129118 onLoaded: {
130− item.model = categoryModels[modelName]
119+ item.model = Qt.binding(function() { return categoryModels[modelName]; });
131120
132121 //FIXME: workaround for lack of previews for videos in Home scope.
133122 //Need to connect to the clicked() signal here and act upon it here instead.