on xenial help sign in
drop debug prints and unused code
5d4bba6Michael Zanetti
qml/Stages/TabletStage.qml+2−25
@@ -54,7 +54,6 @@ Item {
54 property string appId1
54 property string appId1
55
55
56 onFocusedAppIdChanged: {
56 onFocusedAppIdChanged: {
57− print("focused appid changed", priv.focusedAppId)
58 if (priv.focusedAppId.length > 0) {
57 if (priv.focusedAppId.length > 0) {
59 var focusedApp = ApplicationManager.findApplication(focusedAppId);
58 var focusedApp = ApplicationManager.findApplication(focusedAppId);
60 if (focusedApp.stage == ApplicationInfoInterface.SideStage) {
59 if (focusedApp.stage == ApplicationInfoInterface.SideStage) {
@@ -105,17 +104,14 @@ Item {
105 Connections {
104 Connections {
106 target: ApplicationManager
105 target: ApplicationManager
107 onFocusRequested: {
106 onFocusRequested: {
108− printStack()
109 if (spreadView.interactive) {
107 if (spreadView.interactive) {
110 spreadView.snapTo(priv.indexOf(appId));
108 spreadView.snapTo(priv.indexOf(appId));
111 } else {
109 } else {
112−// priv.switchToApp(appId);
113 ApplicationManager.focusApplication(appId)
110 ApplicationManager.focusApplication(appId)
114 }
111 }
115 }
112 }
116
113
117 onApplicationRemoved: {
114 onApplicationRemoved: {
118− printStack()
119 if (priv.mainStageAppId == appId) {
115 if (priv.mainStageAppId == appId) {
120 priv.mainStageAppId = "";
116 priv.mainStageAppId = "";
121 }
117 }
@@ -127,15 +123,6 @@ Item {
127 spreadView.contentX = 0;
123 spreadView.contentX = 0;
128 }
124 }
129 }
125 }
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− }
139 }
126 }
140
127
141 Flickable {
128 Flickable {
@@ -187,7 +174,6 @@ Item {
187 if (ApplicationManager.count <= 2) {
174 if (ApplicationManager.count <= 2) {
188 return -1;
175 return -1;
189 }
176 }
190− print("nextinstack calculation! appId0", priv.appId0, "appid1", priv.appId1, "MS", priv.mainStageAppId, "SS", priv.sideStageAppId)
191 if (priv.appId0 == priv.mainStageAppId || priv.appId0 == priv.sideStageAppId) {
177 if (priv.appId0 == priv.mainStageAppId || priv.appId0 == priv.sideStageAppId) {
192 if (priv.appId1 == priv.mainStageAppId || priv.appId1 == priv.sideStageAppId) {
178 if (priv.appId1 == priv.mainStageAppId || priv.appId1 == priv.sideStageAppId) {
193 return 2;
179 return 2;
@@ -196,12 +182,10 @@ Item {
196 }
182 }
197 return 0;
183 return 0;
198 case "overlay":
184 case "overlay":
199− print("foo", priv.appId0, priv.appId1)
200 return 1;
185 return 1;
201 }
186 }
202− print("unhandled nextInStack case!!!!!");
187+ print("Unhandled nextInStack case! This shouldn't happen any more when the Dash is an app!");
203 return -1;
188 return -1;
204−
205 }
189 }
206 property int nextZInStack: indexToZIndex(nextInStack)
190 property int nextZInStack: indexToZIndex(nextInStack)
207
191
@@ -251,8 +235,6 @@ Item {
251 snapAnimation.start();
235 snapAnimation.start();
252 } else if (contentX < phase1Width) {
236 } else if (contentX < phase1Width) {
253 snapTo(1)
237 snapTo(1)
254−// } else if (contentX < phase1Width + units.gu(5)) {
255−// snapTo(1)
256 } else {
238 } else {
257 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
239 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
258 snapAnimation.targetContentX = spreadView.width * spreadView.positionMarker4 + 1;
240 snapAnimation.targetContentX = spreadView.width * spreadView.positionMarker4 + 1;
@@ -260,9 +242,7 @@ Item {
260 }
242 }
261 }
243 }
262 function snapTo(index) {
244 function snapTo(index) {
263− print("snapping to index", index)
264 spreadView.selectedIndex = index;
245 spreadView.selectedIndex = index;
265−// root.fullscreen = ApplicationManager.get(index).fullscreen;
266 snapAnimation.targetContentX = 0;
246 snapAnimation.targetContentX = 0;
267 snapAnimation.start();
247 snapAnimation.start();
268 }
248 }
@@ -315,7 +295,6 @@ Item {
315 target: spreadView
295 target: spreadView
316 property: "contentX"
296 property: "contentX"
317 to: snapAnimation.targetContentX
297 to: snapAnimation.targetContentX
318−// duration: UbuntuAnimation.SlowDuration
319 duration: UbuntuAnimation.FastDuration
298 duration: UbuntuAnimation.FastDuration
320 }
299 }
321
300
@@ -400,7 +379,7 @@ Item {
400 onReleased: {
379 onReleased: {
401 if (priv.mainStageAppId) {
380 if (priv.mainStageAppId) {
402 var oneWayFlick = priv.evaluateOneWayFlick(gesturePoints);
381 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;
404 sideStageDragSnapAnimation.start();
383 sideStageDragSnapAnimation.start();
405 } else {
384 } else {
406 sideStageDragHandle.dragging = false;
385 sideStageDragHandle.dragging = false;
@@ -513,8 +492,6 @@ Item {
513 width: root.dragAreaWidth
492 width: root.dragAreaWidth
514 direction: Direction.Leftwards
493 direction: Direction.Leftwards
515
494
516−// Rectangle { anchors.fill: parent; color: "#4400FF00"}
517−
518 property bool attachedToView: false
495 property bool attachedToView: false
519 property var gesturePoints: new Array()
496 property var gesturePoints: new Array()
520
497
qml/Stages/TransformedTabletSpreadDelegate.qml−8
@@ -44,9 +44,7 @@ SpreadDelegate {
44 property bool isInSideStage: false
44 property bool isInSideStage: false
45
45
46 onSelectedChanged: {
46 onSelectedChanged: {
47−// print("selected changed:", selected)
48 if (selected) {
47 if (selected) {
49−// print("snappsshotting", index)
50 priv.snapshot();
48 priv.snapshot();
51 }
49 }
52 priv.isSelected = selected;
50 priv.isSelected = selected;
@@ -66,8 +64,6 @@ SpreadDelegate {
66 if (spreadView.phase == 1) {
64 if (spreadView.phase == 1) {
67 var phase2Progress = spreadView.positionMarker4 - (root.zIndex * spreadView.tileDistance / spreadView.width);
65 var phase2Progress = spreadView.positionMarker4 - (root.zIndex * spreadView.tileDistance / spreadView.width);
68 priv.phase2StartTranslate = priv.easingAnimation(0, 1, 0, -spreadView.width + (root.zIndex * root.endDistance), phase2Progress);
66 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−
71 priv.phase2StartScale = priv.easingAnimation(0, 1, root.startScale, root.endScale, phase2Progress)
67 priv.phase2StartScale = priv.easingAnimation(0, 1, root.startScale, root.endScale, phase2Progress)
72 priv.phase2StartAngle = priv.easingAnimation(0, 1, root.startAngle, root.endAngle, phase2Progress)
68 priv.phase2StartAngle = priv.easingAnimation(0, 1, root.startAngle, root.endAngle, phase2Progress)
73 priv.phase2StartTopMarginProgress = priv.easingAnimation(0, 1, 0, 1, phase2Progress)
69 priv.phase2StartTopMarginProgress = priv.easingAnimation(0, 1, 0, 1, phase2Progress)
@@ -106,8 +102,6 @@ SpreadDelegate {
106 selectedScale = priv.scale;
102 selectedScale = priv.scale;
107 selectedOpacity = priv.opacityTransform;
103 selectedOpacity = priv.opacityTransform;
108 selectedTopMarginProgress = topMarginProgress;
104 selectedTopMarginProgress = topMarginProgress;
109−// print("snapshotting at phase", spreadView.phase, negativeProgress);
110−// print("snapshotted", root.zIndex, "prog:", selectedProgress, "translate:", selectedXTranslate, "angle", selectedAngle, "scale", selectedScale)
111 }
105 }
112
106
113 // This calculates how much negative progress there can be if unwinding the spread completely
107 // This calculates how much negative progress there can be if unwinding the spread completely
@@ -139,7 +133,6 @@ SpreadDelegate {
139 }
133 }
140
134
141 if (isSelected) {
135 if (isSelected) {
142−// print("progress:", root.progress, negativeProgress)
143 if (model.stage == ApplicationInfoInterface.MainStage) {
136 if (model.stage == ApplicationInfoInterface.MainStage) {
144 return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, -spreadView.width, root.progress)
137 return linearAnimation(selectedProgress, negativeProgress, selectedXTranslate, -spreadView.width, root.progress)
145 } else {
138 } else {
@@ -260,7 +253,6 @@ SpreadDelegate {
260 }
253 }
261
254
262 // The tile should rotate a bit when another one comes on top, but not when only dragging the side stage in
255 // 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)
264 var shouldMoveAway = spreadView.nextInStack >= 0 && movedActive && (ApplicationManager.get(spreadView.nextInStack).stage === ApplicationInfoInterface.MainStage || model.stage == ApplicationInfoInterface.SideStage)
256 var shouldMoveAway = spreadView.nextInStack >= 0 && movedActive && (ApplicationManager.get(spreadView.nextInStack).stage === ApplicationInfoInterface.MainStage || model.stage == ApplicationInfoInterface.SideStage)
265
257
266 if (spreadView.phase == 0) {
258 if (spreadView.phase == 0) {