on xenial help sign in
More merge issues
commit72f88c5feac9587039c9d9aa61965ef43932f0ff authorAlbert Astals <albert.astals@canonical.com> dateThu 7 Aug 2014, 11:20 (12 years ago) parent67f6aa9
5 files changed+24−10
qml/Dash/Dash.qml+7−1 qml/Dash/GenericScopeView.qml+5−3 qml/Dash/PreviewListView.qml+1−1 qml/Dash/ScopesOverview.qml−1 tests/qmltests/Dash/tst_Dash.qml+11−4
qml/Dash/Dash.qml+7−1
@@ -113,7 +113,13 @@ Showable {
113113 hide();
114114 }
115115 onSearchSelected: {
116− var scopeIndex = filteredScopes.findFirst(Scopes.RoleId, scopeId);
116+ var scopeIndex = -1;
117+ for (var i = 0; i < scopes.count; ++i) {
118+ if (scopes.getScope(i).id == scopeId) {
119+ scopeIndex = i;
120+ break;
121+ }
122+ }
117123 if (scopeIndex >= 0) {
118124 // Is a favorite one
119125 setCurrentScope(scopeId, false, false);
qml/Dash/GenericScopeView.qml+5−3
@@ -25,7 +25,7 @@ import "../Components/ListItems" as ListItems
2525FocusScope {
2626 id: scopeView
2727
28− readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem.showList : false
28+ readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].showList : false
2929 property var scope: null
3030 property SortFilterProxyModel categories: categoryFilter
3131 property bool isCurrent: false
@@ -35,8 +35,8 @@ FocusScope {
3535 property var categoryView: categoryView
3636 property bool showPageHeader: true
3737 readonly property alias previewShown: previewListView.open
38− property alias paginationCount: pageHeader.paginationCount
39− property alias paginationIndex: pageHeader.paginationIndex
38+ property int paginationCount: 0
39+ property int paginationIndex: 0
4040
4141 property var scopeStyle: ScopeStyle {
4242 style: scope ? scope.customizations : {}
@@ -417,6 +417,8 @@ FocusScope {
417417 showBackButton: scopeView.hasBackAction
418418 searchEntryEnabled: true
419419 scopeStyle: scopeView.scopeStyle
420+ paginationCount: scopeView.paginationCount
421+ paginationIndex: scopeView.paginationIndex
420422
421423 bottomItem: DashNavigation {
422424 scope: scopeView.scope
qml/Dash/PreviewListView.qml+1−1
@@ -108,7 +108,7 @@ Item {
108108 anchors {
109109 left: parent.left
110110 right: parent.right
111− top: pageHeader.bottom
111+ top: header.bottom
112112 bottom: parent.bottom
113113 }
114114
qml/Dash/ScopesOverview.qml−1
@@ -188,7 +188,6 @@ Item {
188188 scopeStyle: overviewScopeStyle
189189 showSignatureLine: false
190190 searchEntryEnabled: true
191− searchInProgress: root.scope ? root.scope.searchInProgress : false
192191 }
193192
194193 ScopesOverviewTab {
tests/qmltests/Dash/tst_Dash.qml+11−4
@@ -59,9 +59,9 @@ Item {
5959 function get_scope_data() {
6060 return [
6161 { tag: "MockScope1", visualIndex: 0 },
62− { tag: "MockScope2", visualIndex: 1 },
63− { tag: "clickscope", visualIndex: 2 },
64− { tag: "MockScope5", visualIndex: 3 },
62+ { tag: "MockScope2", visualIndex: -1 },
63+ { tag: "clickscope", visualIndex: 1 },
64+ { tag: "MockScope5", visualIndex: 2 },
6565 ]
6666 }
6767
@@ -80,7 +80,14 @@ Item {
8080 tryCompare(dashContentList, "count", 6);
8181
8282 verify(dashContentList != undefined);
83− tryCompare(dashContentList, "currentIndex", data.visualIndex);
83+ if (data.visualIndex == -1) {
84+ tryCompare(dashContentList, "currentIndex", 0);
85+ expectFail(data.tag, "non favorite scopes should not be visble in the scopes model");
86+ compare(dashContentList.currentItem.scopeId, data.tag); // this should fail
87+ } else {
88+ tryCompare(dashContentList, "currentIndex", data.visualIndex);
89+ compare(dashContentList.currentItem.scopeId, data.tag);
90+ }
8491 }
8592
8693 function test_dash_overview_show_select_same_favorite() {