on xenial help sign in
cleanup unrelated stuff
commitbd00ab245adbda05b6912d26ede6bfc6e2238455 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateSat 19 Sep 2015, 14:16 (11 years ago) parent38784d8
5 files changed+25−28
qml/Notifications/Notification.qml+18−19 qml/Notifications/SwipeToAct.qml+2−5 qml/OrientedShell.qml+1 tests/qmltests/Notifications/tst_Notifications.qml+2−2 tests/qmltests/Notifications/tst_SwipeToAct.qml+2−2
qml/Notifications/Notification.qml+18−19
@@ -21,7 +21,6 @@ import Ubuntu.Components 1.2
2121import Unity.Notifications 1.0
2222import QMenuModel 0.1
2323import Utils 0.1
24−import "../Components/UnityInputInfo"
2524import Ubuntu.Components.ListItems 0.1 as ListItem
2625
2726Item {
@@ -61,12 +60,12 @@ Item {
6160 state: {
6261 var result = "";
6362
64− if (type === Notification.SnapDecision) {
65− if (ListView.view.currentIndex === index) {
63+ if (type == Notification.SnapDecision) {
64+ if (ListView.view.currentIndex == index) {
6665 result = "expanded";
6766 } else {
6867 if (ListView.view.count > 2) {
69− if (ListView.view.currentIndex === -1 && index == 1) {
68+ if (ListView.view.currentIndex == -1 && index == 1) {
7069 result = "expanded";
7170 } else {
7271 result = "contracted";
@@ -84,7 +83,7 @@ Item {
8483 id: sound
8584 objectName: "sound"
8685 audioRole: MediaPlayer.alert
87− source: hints["suppress-sound"] !== "true" && !!hints["sound-file"] ? hints["sound-file"] : ""
86+ source: hints["suppress-sound"] !== "true" && hints["sound-file"] !== undefined ? hints["sound-file"] : ""
8887 }
8988
9089 Component.onCompleted: {
@@ -141,7 +140,7 @@ Item {
141140
142141 clip: fullscreen ? false : true
143142
144− visible: type !== Notification.PlaceHolder
143+ visible: type != Notification.PlaceHolder
145144
146145 UbuntuShape {
147146 id: shapedBack
@@ -197,7 +196,7 @@ Item {
197196 actions: paths.actions
198197 menuObjectPath: paths.menuObjectPath
199198 onNameOwnerChanged: {
200− if (lastNameOwner !== "" && nameOwner === "" && !!notification.notification) {
199+ if (lastNameOwner !== "" && nameOwner === "" && notification.notification !== undefined) {
201200 notification.notification.close()
202201 }
203202 lastNameOwner = nameOwner
@@ -216,7 +215,7 @@ Item {
216215 drag.maximumX: notification.width
217216
218217 onClicked: {
219− if (notification.type === Notification.Interactive) {
218+ if (notification.type == Notification.Interactive) {
220219 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
221220 } else if (clickToClose && canBeClosed) {
222221 notification.notification.close()
@@ -260,10 +259,10 @@ Item {
260259 id: icon
261260
262261 objectName: "icon"
263− width: type === Notification.Ephemeral && !bodyLabel.visible ? units.gu(3) : units.gu(6)
262+ width: type == Notification.Ephemeral && !bodyLabel.visible ? units.gu(3) : units.gu(6)
264263 height: width
265− shaped: notification.hints["x-canonical-non-shaped-icon"] === "true" ? false : true
266− visible: !!iconSource && iconSource !== "" && type !== Notification.Confirmation
264+ shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
265+ visible: iconSource !== undefined && iconSource !== "" && type !== Notification.Confirmation
267266 }
268267
269268 Column {
@@ -299,7 +298,7 @@ Item {
299298 fontSize: "small"
300299 color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
301300 wrapMode: Text.WordWrap
302− maximumLineCount: type === Notification.SnapDecision ? 12 : 2
301+ maximumLineCount: type == Notification.SnapDecision ? 12 : 2
303302 elide: Text.ElideRight
304303 textFormat: Text.StyledText
305304 }
@@ -317,7 +316,7 @@ Item {
317316 }
318317
319318 ListItem.ThinDivider {
320− visible: type === Notification.SnapDecision
319+ visible: type == Notification.SnapDecision
321320 }
322321
323322 ShapedIcon {
@@ -325,9 +324,9 @@ Item {
325324 objectName: "centeredIcon"
326325 width: units.gu(5)
327326 height: width
328− shaped: notification.hints["x-canonical-non-shaped-icon"] === "true" ? false : true
327+ shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
329328 fileSource: icon.fileSource
330− visible: !!fileSource && fileSource !== "" && type === Notification.Confirmation
329+ visible: fileSource !== undefined && fileSource !== "" && type === Notification.Confirmation
331330 anchors.horizontalCenter: parent.horizontalCenter
332331 }
333332
@@ -443,7 +442,7 @@ Item {
443442 objectName: "notify_oot_button" + index
444443 width: oneOverTwoCase.width
445444 text: oneOverTwoLoaderTop.actionLabel
446− color: notification.hints["x-canonical-private-affirmative-tint"] === "true" ? green : sdDarkGrey
445+ color: index == 1 && notification.hints["x-canonical-private-rejection-tint"] == "true" ? red : sdDarkGrey
447446 onClicked: notification.notification.invokeAction(oneOverTwoLoaderTop.actionId)
448447 }
449448 }
@@ -533,10 +532,10 @@ Item {
533532 text: loader.actionLabel
534533 color: {
535534 var result = sdDarkGrey;
536− if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] === "true") {
535+ if (index == 0 && notification.hints["x-canonical-private-affirmative-tint"] == "true") {
537536 result = green;
538537 }
539− if (index == 1 && notification.hints["x-canonical-private-rejection-tint"] === "true") {
538+ if (index == 1 && notification.hints["x-canonical-private-rejection-tint"] == "true") {
540539 result = red;
541540 }
542541 return result;
@@ -559,7 +558,7 @@ Item {
559558 margins: contentSpacing
560559 }
561560
562− visible: notification.type === Notification.SnapDecision && actionRepeater.count > 3 && !oneOverTwoCase.visible
561+ visible: notification.type == Notification.SnapDecision && actionRepeater.count > 3 && !oneOverTwoCase.visible
563562 model: notification.actions
564563 expanded: false
565564 startIndex: 2
qml/Notifications/SwipeToAct.qml+2−5
@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.3
1818import Ubuntu.Components 1.2
19−import "../Components/UnityInputInfo"
2019
2120Item {
2221 id: swipeToAct
@@ -75,7 +74,6 @@ Item {
7574 iconName: leftIconName
7675 visible: clickToAct
7776 width: (parent.width / 2) - priv.gap
78− height: leftShape.height
7977 color: UbuntuColors.red
8078 onClicked: {
8179 leftTriggered()
@@ -90,7 +88,6 @@ Item {
9088 iconName: rightIconName
9189 visible: clickToAct
9290 width: (parent.width / 2) - priv.gap
93− height: rightShape.height
9491 color: UbuntuColors.green
9592 onClicked: {
9693 rightTriggered()
@@ -126,7 +123,6 @@ Item {
126123 height: units.gu(3.5)
127124 name: leftIconName
128125 color: "white"
129−
130126 }
131127 }
132128
@@ -178,7 +174,8 @@ Item {
178174
179175 onXChanged: {
180176 var factor
181− if (slider.x <= priv.gap + leftShape.width) {
177+ if (slider.x <= priv.gap + leftShape.width)
178+ {
182179 factor = (slider.x - priv.gap) / leftShape.width
183180 slider.color = priv.interpolate(leftShape.color, priv.sliderMainColor, factor)
184181 } else if (slider.x >= rightShape.x - slider.width) {
qml/OrientedShell.qml+1
@@ -44,6 +44,7 @@ Rectangle {
4444 name: applicationArguments.deviceName
4545 }
4646
47+
4748 // to be overwritten by tests
4849 property var unity8Settings: Unity8Settings {}
4950 property var oskSettings: GSettings { schema.id: "com.canonical.keyboard.maliit" }
tests/qmltests/Notifications/tst_Notifications.qml+2−2
@@ -578,7 +578,7 @@ Item {
578578 waitForRendering(notifications);
579579
580580 var notification = findChild(notifications, "notification" + (mockModel.count - 1))
581− verify(!!notification, "notification wasn't found");
581+ verify(notification !== undefined, "notification wasn't found");
582582
583583 waitForRendering(notification);
584584 tryCompare(notification, "height", notification.state === "contracted" ? units.gu(10) : notification.implicitHeight);
@@ -672,7 +672,7 @@ Item {
672672 actionSpy.clear()
673673
674674 // click to collapse
675− tryCompareFunction(function() { mouseClick(comboButton, comboButton.width / 2, comboButton.height / 2); return comboButton.expanded === false; }, true);
675+ tryCompareFunction(function() { mouseClick(comboButton, comboButton.width / 2, comboButton.height / 2); return comboButton.expanded == false; }, true);
676676 } else {
677677 mouseClick(buttonCancel)
678678 compare(actionSpy.signalArguments[0][0], data.n.actions.data(1, ActionModel.RoleActionId), "got wrong id for negative action")
tests/qmltests/Notifications/tst_SwipeToAct.qml+2−2
@@ -247,7 +247,7 @@ Item {
247247 waitForRendering(notifications);
248248
249249 var notification = findChild(notifications, "notification" + (mockModel.count - 1))
250− verify(!!notification, "notification wasn't found");
250+ verify(notification !== undefined, "notification wasn't found");
251251
252252 waitForRendering(notification);
253253
@@ -265,7 +265,7 @@ Item {
265265
266266 // test input does not fall through
267267 mouseClick(notification)
268− if(data.type === Notification.Interactive) {
268+ if(data.type == Notification.Interactive) {
269269 actionSpy.wait()
270270 compare(actionSpy.signalArguments[0][0], data.actions[0]["id"], "got wrong id for interactive action")
271271 }