on xenial help sign in
drop scope initialisation logic as we want to have 0 all the time now
a3cc5b0Michael Zanetti
qml/Dash/Dash.qml+1−9
@@ -28,14 +28,12 @@ Showable {
28
28
29 visible: shown
29 visible: shown
30
30
31− property string showScopeOnLoaded: "clickscope"
32−
33 DashCommunicatorService {
31 DashCommunicatorService {
34 objectName: "dashCommunicatorService"
32 objectName: "dashCommunicatorService"
35 onSetCurrentScopeRequested: {
33 onSetCurrentScopeRequested: {
36 if (!isSwipe || !window.active || overviewController.progress != 0) {
34 if (!isSwipe || !window.active || overviewController.progress != 0) {
37 if (overviewController.progress != 0 && window.active) animate = false;
35 if (overviewController.progress != 0 && window.active) animate = false;
38− dashContent.setCurrentScopeAtIndex(scopeIndex, animate, isSwipe)
36+ dashContent.setCurrentScopeAtIndex(index, animate, isSwipe)
39 if (overviewController.progress != 0) {
37 if (overviewController.progress != 0) {
40 if (window.active) {
38 if (window.active) {
41 dashContentCache.scheduleUpdate();
39 dashContentCache.scheduleUpdate();
@@ -184,12 +182,6 @@ Showable {
184 scopesOverview.ensureAllScopeVisible(scope.id);
182 scopesOverview.ensureAllScopeVisible(scope.id);
185 x = -width;
183 x = -width;
186 }
184 }
187− onScopeLoaded: {
188− if (scopeId == dash.showScopeOnLoaded) {
189− dash.setCurrentScope(scopeId, false, false)
190− dash.showScopeOnLoaded = ""
191− }
192− }
193 clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0
185 clip: scale != 1.0 || scopeItem.visible || overviewController.progress != 0
194 Behavior on x {
186 Behavior on x {
195 UbuntuNumberAnimation {
187 UbuntuNumberAnimation {
tests/qmltests/Dash/tst_Dash.qml+3−23
@@ -36,7 +36,6 @@ Item {
36 Dash {
36 Dash {
37 id: dash
37 id: dash
38 anchors.fill: parent
38 anchors.fill: parent
39− showScopeOnLoaded: "MockScope2"
40 }
39 }
41
40
42 UT.UnityTestCase {
41 UT.UnityTestCase {
@@ -80,27 +79,6 @@ Item {
80 return get_scope_data()
79 return get_scope_data()
81 }
80 }
82
81
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−
104 function test_dash_overview_show_select_same_favorite() {
82 function test_dash_overview_show_select_same_favorite() {
105 // Show the overview
83 // Show the overview
106 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
84 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));
@@ -314,7 +292,9 @@ Item {
314 mouseFlick(dash, startX, startY, stopX, stopY);
292 mouseFlick(dash, startX, startY, stopX, stopY);
315 compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
293 compare(dashContentList.currentIndex, 2, "Could not flick to scope id 2");
316 var dashCommunicatorService = findInvisibleChild(dash, "dashCommunicatorService");
294 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);
318 tryCompare(dashContentList, "currentIndex", 1)
298 tryCompare(dashContentList, "currentIndex", 1)
319 }
299 }
320
300