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