@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import Unity 0.1
1920import Utils 0.1
2021import "../Components"
2122import "../Components/ListItems"
@@ -52,42 +53,33 @@ ScopeView {
5253 FrequentlyUsedAppsModel { id: appsModel }
5354
5455 // 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− }
56+ property var musicModel: null
57+ property var videosModel: null
6158
62− SortFilterProxyModel {
63− id: recentFilter
64− dynamicSortFilter: true
65− filterRole: 2
66− filterRegExp: /^2$/
67− }
59+ Repeater {
60+ id: musicRepeater
6861
69− SortFilterProxyModel {
70− id: musicFilter
71− dynamicSortFilter: true
72− filterRole: 2
73− filterRegExp: /^1$/
62+ delegate: Item {
63+ Component.onCompleted: if (index == 1) musicModel = Qt.binding(function() { return model.results; });
64+ }
7465 }
7566
76− SortFilterProxyModel {
77− id: videosFilter
78− dynamicSortFilter: true
79− filterRole: 2
80− filterRegExp: /^3$/
67+ Repeater {
68+ id: videosRepeater
69+
70+ delegate: Item {
71+ Component.onCompleted: if (index == 3) videosModel = Qt.binding(function() { return model.results; });
72+ }
8173 }
8274
8375 Component.onCompleted: {
8476 var scope = dashContent.scopes.get("mockmusicmaster.scope")
8577 if (scope) {
86− musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
78+ musicRepeater.model = dashContent.scopes.get("mockmusicmaster.scope").categories
8779 }
8880 scope = dashContent.scopes.get("mockvideosmaster.scope")
8981 if (scope) {
90− videosFilter.model = dashContent.scopes.get("mockvideosmaster.scope").results
82+ videosRepeater.model = dashContent.scopes.get("mockvideosmaster.scope").categories
9183 }
9284 }
9385
@@ -95,19 +87,17 @@ ScopeView {
9587 target: dashContent
9688 onScopeLoaded: switch (scopeId) {
9789 case "mockmusicmaster.scope":
98− musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
90+ musicRepeater.model = dashContent.scopes.get("mockmusicmaster.scope").categories
9991 break;
10092 case "mockvideosmaster.scope":
101− videosFilter.model = dashContent.scopes.get("mockvideosmaster.scope").results
93+ videosRepeater.model = dashContent.scopes.get("mockvideosmaster.scope").categories
10294 break;
10395 }
10496 }
10597
10698 property var categoryModels: {"AppsModel": appsModel,
107− "FavouriteModel": favouritesFilter,
108− "RecentModel": recentFilter,
109− "MusicModel": musicFilter,
110− "VideosModel": videosFilter,
99+ "MusicModel": musicModel,
100+ "VideosModel": videosModel,
111101 }
112102
113103 ScopeListView {
@@ -127,7 +117,7 @@ ScopeView {
127117 anchors { top: parent.top; left: parent.left; right: parent.right }
128118 source: component
129119 onLoaded: {
130− item.model = categoryModels[modelName]
120+ item.model = Qt.binding(function() { return categoryModels[modelName]; });
131121
132122 //FIXME: workaround for lack of previews for videos in Home scope.
133123 //Need to connect to the clicked() signal here and act upon it here instead.