@@ -52,42 +52,33 @@ ScopeView {
52 FrequentlyUsedAppsModel { id: appsModel }
52 FrequentlyUsedAppsModel { id: appsModel }
54 // FIXME this should be handled by the backends by populating the global search model
54 // FIXME this should be handled by the backends by populating the global search model
55− SortFilterProxyModel {
55+ property var musicModel: null
56− id: favouritesFilter
56+ property var videosModel: null
57− dynamicSortFilter: true
62− SortFilterProxyModel {
58+ Repeater {
63− id: recentFilter
59+ id: musicRepeater
64− dynamicSortFilter: true
69− SortFilterProxyModel {
61+ delegate: Item {
70− id: musicFilter
62+ Component.onCompleted: if (index == 1) musicModel = Qt.binding(function() { return model.results; });
71− dynamicSortFilter: true
63+ }
76− SortFilterProxyModel {
66+ Repeater {
77− id: videosFilter
67+ id: videosRepeater
78− dynamicSortFilter: true
68+
79− filterRole: 2
69+ delegate: Item {
80− filterRegExp: /^3$/
70+ Component.onCompleted: if (index == 3) videosModel = Qt.binding(function() { return model.results; });
83 Component.onCompleted: {
74 Component.onCompleted: {
84 var scope = dashContent.scopes.get("mockmusicmaster.scope")
75 var scope = dashContent.scopes.get("mockmusicmaster.scope")
85 if (scope) {
76 if (scope) {
86− musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
77+ musicRepeater.model = dashContent.scopes.get("mockmusicmaster.scope").categories
88 scope = dashContent.scopes.get("mockvideosmaster.scope")
79 scope = dashContent.scopes.get("mockvideosmaster.scope")
89 if (scope) {
80 if (scope) {
90− videosFilter.model = dashContent.scopes.get("mockvideosmaster.scope").results
81+ videosRepeater.model = dashContent.scopes.get("mockvideosmaster.scope").categories
@@ -95,19 +86,17 @@ ScopeView {
95 target: dashContent
86 target: dashContent
96 onScopeLoaded: switch (scopeId) {
87 onScopeLoaded: switch (scopeId) {
97 case "mockmusicmaster.scope":
88 case "mockmusicmaster.scope":
98− musicFilter.model = dashContent.scopes.get("mockmusicmaster.scope").results
89+ musicRepeater.model = dashContent.scopes.get("mockmusicmaster.scope").categories
100 case "mockvideosmaster.scope":
91 case "mockvideosmaster.scope":
101− videosFilter.model = dashContent.scopes.get("mockvideosmaster.scope").results
92+ videosRepeater.model = dashContent.scopes.get("mockvideosmaster.scope").categories
106 property var categoryModels: {"AppsModel": appsModel,
97 property var categoryModels: {"AppsModel": appsModel,
107− "FavouriteModel": favouritesFilter,
108− "RecentModel": recentFilter,
109− "MusicModel": musicFilter,
98+ "MusicModel": musicModel,
110− "VideosModel": videosFilter,
99+ "VideosModel": videosModel,
113 ScopeListView {
102 ScopeListView {
@@ -127,7 +116,7 @@ ScopeView {
127 anchors { top: parent.top; left: parent.left; right: parent.right }
116 anchors { top: parent.top; left: parent.left; right: parent.right }
128 source: component
117 source: component
129 onLoaded: {
118 onLoaded: {
130− item.model = categoryModels[modelName]
119+ item.model = Qt.binding(function() { return categoryModels[modelName]; });
132 //FIXME: workaround for lack of previews for videos in Home scope.
121 //FIXME: workaround for lack of previews for videos in Home scope.
133 //Need to connect to the clicked() signal here and act upon it here instead.
122 //Need to connect to the clicked() signal here and act upon it here instead.