on xenial help sign in
drop debug prints and unused code
commit5d4bba6ce8f8a3b4d2fd3efa6cb83de2ad686873 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 4 Jul 2014, 12:34 (12 years ago) parente59a12e
2 files changed+2−33
qml/Stages/TabletStage.qml+2−25 qml/Stages/TransformedTabletSpreadDelegate.qml−8
qml/Stages/TabletStage.qml+2−25
@@ -54,7 +54,6 @@ Item {
5454 property string appId1
5555
5656 onFocusedAppIdChanged: {
57− print("focused appid changed", priv.focusedAppId)
5857 if (priv.focusedAppId.length > 0) {
5958 var focusedApp = ApplicationManager.findApplication(focusedAppId);
6059 if (focusedApp.stage == ApplicationInfoInterface.SideStage) {
@@ -105,17 +104,14 @@ Item {
105104 Connections {
106105 target: ApplicationManager
107106 onFocusRequested: {
108− printStack()
109107 if (spreadView.interactive) {
110108 spreadView.snapTo(priv.indexOf(appId));
111109 } else {
112−// priv.switchToApp(appId);
113110 ApplicationManager.focusApplication(appId)
114111 }
115112 }
116113
117114 onApplicationRemoved: {
118− printStack()
119115 if (priv.mainStageAppId == appId) {
120116 priv.mainStageAppId = "";
121117 }
@@ -127,15 +123,6 @@ Item {
127123 spreadView.contentX = 0;
128124 }
129125 }
130− onApplicationAdded: {
131− printStack()
132− }
133− }
134−
135− function printStack() {
136− for (var i = 0; i < ApplicationManager.count; i++) {
137− print("AppMan item", i, ":", ApplicationManager.get(i).appId)
138− }
139126 }
140127
141128 Flickable {
@@ -187,7 +174,6 @@ Item {
187174 if (ApplicationManager.count <= 2) {
188175 return -1;
189176 }
190− print("nextinstack calculation! appId0", priv.appId0, "appid1", priv.appId1, "MS", priv.mainStageAppId, "SS", priv.sideStageAppId)
191177 if (priv.appId0 == priv.mainStageAppId || priv.appId0 == priv.sideStageAppId) {
192178 if (priv.appId1 == priv.mainStageAppId || priv.appId1 == priv.sideStageAppId) {
193179 return 2;
@@ -196,12 +182,10 @@ Item {
196182 }
197183 return 0;
198184 case "overlay":
199− print("foo", priv.appId0, priv.appId1)
200185 return 1;
201186 }
202− print("unhandled nextInStack case!!!!!");
187+ print("Unhandled nextInStack case! This shouldn't happen any more when the Dash is an app!");
203188 return -1;
204−
205189 }
206190 property int nextZInStack: indexToZIndex(nextInStack)
207191
@@ -251,8 +235,6 @@ Item {
251235 snapAnimation.start();
252236 } else if (contentX < phase1Width) {
253237 snapTo(1)
254−// } else if (contentX < phase1Width + units.gu(5)) {
255−// snapTo(1)
256238 } else {
257239 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
258240 snapAnimation.targetContentX = spreadView.width * spreadView.positionMarker4 + 1;
@@ -260,9 +242,7 @@ Item {
260242 }
261243 }
262244 function snapTo(index) {
263− print("snapping to index", index)
264245 spreadView.selectedIndex = index;
265−// root.fullscreen = ApplicationManager.get(index).fullscreen;
266246 snapAnimation.targetContentX = 0;
267247 snapAnimation.start();
268248 }
@@ -315,7 +295,6 @@ Item {
315295 target: spreadView
316296 property: "contentX"
317297 to: snapAnimation.targetContentX
318−// duration: UbuntuAnimation.SlowDuration
319298 duration: UbuntuAnimation.FastDuration
320299 }
321300
@@ -400,7 +379,7 @@ Item {
400379 onReleased: {
401380 if (priv.mainStageAppId) {
402381 var oneWayFlick = priv.evaluateOneWayFlick(gesturePoints);
403− sideStageDragSnapAnimation.to = sideStageDragHandle.progress > 0.5 || oneWayFlick ? 1 : 0
382+ sideStageDragSnapAnimation.to = sideStageDragHandle.progress > 0.5 || oneWayFlick ? 1 : 0;
404383 sideStageDragSnapAnimation.start();
405384 } else {
406385 sideStageDragHandle.dragging = false;
@@ -513,8 +492,6 @@ Item {
513492 width: root.dragAreaWidth
514493 direction: Direction.Leftwards
515494
516−// Rectangle { anchors.fill: parent; color: "#4400FF00"}
517−
518495 property bool attachedToView: false
519496 property var gesturePoints: new Array()
520497
qml/Stages/TransformedTabletSpreadDelegate.qml−8
@@ -44,9 +44,7 @@ SpreadDelegate {
4444 property bool isInSideStage: false
4545
4646 onSelectedChanged: {
47−// print("selected changed:", selected)
4847 if (selected) {
49−// print("snappsshotting", index)
5048 priv.snapshot();
5149 }
5250 priv.isSelected = selected;
@@ -66,8 +64,6 @@ SpreadDelegate {
6664 if (spreadView.phase == 1) {
6765 var phase2Progress = spreadView.positionMarker4 - (root.zIndex * spreadView.tileDistance / spreadView.width);
6866 priv.phase2StartTranslate = priv.easingAnimation(0, 1, 0, -spreadView.width + (root.zIndex * root.endDistance), phase2Progress);
69−// print("calculating end value for", root.zIndex, priv.phase2StartTranslate, "startprogress:", phase2Progress)
70−
7167 priv.phase2StartScale = priv.easingAnimation(0, 1, root.startScale, root.endScale, phase2Progress)
7268 priv.phase2StartAngle = priv.easingAnimation(0, 1, root.startAngle, root.endAngle, phase2Progress)
7369 priv.phase2StartTopMarginProgress = priv.easingAnimation(0, 1, 0, 1, phase2Progress)
@@ -106,8 +102,6 @@ SpreadDelegate {
106102 selectedScale = priv.scale;
107103 selectedOpacity = priv.opacityTransform;
108104 selectedTopMarginProgress = topMarginProgress;
109−// print("snapshotting at phase", spreadView.phase, negativeProgress);
110−// print("snapshotted", root.zIndex, "prog:", selectedProgress, "translate:", selectedXTranslate, "angle", selectedAngle, "scale", selectedScale)
111105 }
112106
113107 // This calculates how much negative progress there can be if unwinding the spread completely
@@ -139,7 +133,6 @@ SpreadDelegate {
139133 }
140134
141135 if (isSelected) {
142−// print("progress:", root.progress, negativeProgress)
143136 if (model.stage == ApplicationInfoInterface.MainStage) {
144137 return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, -spreadView.width, root.progress)
145138 } else {
@@ -260,7 +253,6 @@ SpreadDelegate {
260253 }
261254
262255 // The tile should rotate a bit when another one comes on top, but not when only dragging the side stage in
263−// print("nextinstack", spreadView.nextInStack, ApplicationManager.count)
264256 var shouldMoveAway = spreadView.nextInStack >= 0 && movedActive && (ApplicationManager.get(spreadView.nextInStack).stage === ApplicationInfoInterface.MainStage || model.stage == ApplicationInfoInterface.SideStage)
265257
266258 if (spreadView.phase == 0) {