on xenial help sign in
drop scope initialisation logic as we want to have 0 all the time now
commita3cc5b0a06a5590290158f3740d4f56c97bbe99e authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 22 Oct 2014, 16:18 (12 years ago) parentb6020f0
2 files changed+4−32
qml/Dash/Dash.qml+1−9 tests/qmltests/Dash/tst_Dash.qml+3−23
qml/Dash/Dash.qml+1−9
@@ -28,14 +28,12 @@ Showable {
2828
2929 visible: shown
3030
31− property string showScopeOnLoaded: "clickscope"
32−
3331 DashCommunicatorService {
3432 objectName: "dashCommunicatorService"
3533 onSetCurrentScopeRequested: {
3634 if (!isSwipe || !window.active || overviewController.progress != 0) {
3735 if (overviewController.progress != 0 && window.active) animate = false;
38− dashContent.setCurrentScopeAtIndex(scopeIndex, animate, isSwipe)
36+ dashContent.setCurrentScopeAtIndex(index, animate, isSwipe)
3937 if (overviewController.progress != 0) {
4038 if (window.active) {
4139 dashContentCache.scheduleUpdate();
@@ -184,12 +182,6 @@ Showable {
184182 scopesOverview.ensureAllScopeVisible(scope.id);
185183 x = -width;
186184 }
187− onScopeLoaded: {
188− if (scopeId == dash.showScopeOnLoaded) {
189− dash.setCurrentScope(scopeId, false, false)
190− dash.showScopeOnLoaded = ""
191− }
192− }
193185 clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0
194186 Behavior on x {
195187 UbuntuNumberAnimation {
tests/qmltests/Dash/tst_Dash.qml+3−23
@@ -36,7 +36,6 @@ Item {
3636 Dash {
3737 id: dash
3838 anchors.fill: parent
39− showScopeOnLoaded: "MockScope2"
4039 }
4140
4241 UT.UnityTestCase {
@@ -80,27 +79,6 @@ Item {
8079 return get_scope_data()
8180 }
8281
83− function test_show_scope_on_load(data) {
84− var dashContentList = findChild(dash, "dashContentList");
85−
86− dash.showScopeOnLoaded = data.tag
87− scopes.clear();
88− tryCompare(dashContentList, "count", 0);
89− scopes.load();
90− tryCompare(scopes, "loaded", true);
91− tryCompare(dashContentList, "count", 6);
92−
93− verify(dashContentList != undefined);
94− if (data.visualIndex == -1) {
95− tryCompare(dashContentList, "currentIndex", 0);
96− expectFail(data.tag, "non favorite scopes should not be visble in the scopes model");
97− compare(dashContentList.currentItem.scopeId, data.tag); // this should fail
98− } else {
99− tryCompare(dashContentList, "currentIndex", data.visualIndex);
100− compare(dashContentList.currentItem.scopeId, data.tag);
101− }
102− }
103−
10482 function test_dash_overview_show_select_same_favorite() {
10583 // Show the overview
10684 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -314,7 +292,9 @@ Item {
314292 mouseFlick(dash, startX, startY, stopX, stopY);
315293 compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
316294 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
317− dashCommunicatorService.mockSetCurrentScope("clickscope", true, false);
295+ dashCommunicatorService.mockSetCurrentScope(0, true, false);
296+ tryCompare(dashContentList, "currentIndex", 0)
297+ dashCommunicatorService.mockSetCurrentScope(1, true, false);
318298 tryCompare(dashContentList, "currentIndex", 1)
319299 }
320300