aboutsummaryrefslogtreecommitdiffstats
path: root/testing/asteroid-launcher/0001-use-mce-battery-api-and-fix-deprecation-issues.patch
blob: a683f339e96e8797f8c1a36c0bc15f1b105be50f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
From bf64dce48823cc8e11d2833542d659cabc37bfde Mon Sep 17 00:00:00 2001
From: MagneFire <IDaNLContact@gmail.com>
Date: Sun, 4 Apr 2021 20:51:52 +0200
Subject: [PATCH 1/2] QuickSettings: Use Mce for battery information.

---
 qml/quicksettings/QuickSettings.qml | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/qml/quicksettings/QuickSettings.qml b/qml/quicksettings/QuickSettings.qml
index ee13e7c..344b72b 100644
--- a/qml/quicksettings/QuickSettings.qml
+++ b/qml/quicksettings/QuickSettings.qml
@@ -29,7 +29,7 @@
  */
 
 import QtQuick 2.9
-import org.freedesktop.contextkit 1.0
+import Nemo.Mce 1.0
 import Nemo.DBus 2.0
 import org.nemomobile.systemsettings 1.0
 import Nemo.Ngf 1.0
@@ -44,17 +44,12 @@ Item {
     property bool forbidLeft:  true
     property bool forbidRight: true
 
-    ContextProperty {
+    MceBatteryLevel {
         id: batteryChargePercentage
-        key: "Battery.ChargePercentage"
-        value: "100"
-        Component.onCompleted: batteryChargePercentage.subscribe()
     }
 
-    ContextProperty {
-        id: batteryIsCharging
-        key: "Battery.IsCharging"
-        value: false
+    MceBatteryState {
+        id: batteryChargeState
     }
 
     DBusInterface {
@@ -149,9 +144,9 @@ Item {
         Icon {
             id: batteryIcon
             name: {
-                if(batteryIsCharging.value)                 return "ios-battery-charging"
-                else if(batteryChargePercentage.value > 15) return "ios-battery-full"
-                else                                        return "ios-battery-dead"
+                if(batteryChargeState.value == MceBatteryState.Charging) return "ios-battery-charging"
+                else if(batteryChargePercentage.percent > 15)            return "ios-battery-full"
+                else                                                     return "ios-battery-dead"
             }
             width:  parent.height/2
             height: width
@@ -161,7 +156,7 @@ Item {
         Label {
             id: batteryIndicator
             font.pixelSize: parent.height/4
-            text: batteryChargePercentage.value + "%"
+            text: batteryChargePercentage.percent + "%"
             anchors.right: parent.right
             anchors.verticalCenter: parent.verticalCenter
         }

From c9b69fc8a287b07d929a248df7b8c840a8618b61 Mon Sep 17 00:00:00 2001
From: MagneFire <IDaNLContact@gmail.com>
Date: Sun, 4 Apr 2021 23:07:39 +0200
Subject: [PATCH 2/2] Connections: Use Qt 5.15 API for connecting functions. As
 of Qt 5.15 the Connections QML type requires a different way of connecting
 functions.

---
 qml/MainScreen.qml                            | 19 ++++++++++---------
 qml/misc/BluetoothAgent.qml                   |  2 +-
 qml/notifications/NotificationActions.qml     |  2 +-
 qml/notifications/NotificationIndicator.qml   |  4 ++--
 qml/notifications/NotificationPreview.qml     |  2 +-
 qml/notifications/NotificationView.qml        |  2 +-
 watchfaces/000-default-digital.qml            |  2 +-
 watchfaces/001-words-worte-palabras-mots.qml  |  2 +-
 watchfaces/002-analog-70s-classic.qml         |  2 +-
 watchfaces/003-alternative-digital-2.qml      |  4 ++--
 watchfaces/004-alternative-scifi.qml          |  4 ++--
 watchfaces/005-analog-nordic.qml              |  2 +-
 watchfaces/006-analog-50s-americana.qml       |  4 ++--
 watchfaces/007-bold-hour-bebas.qml            |  2 +-
 watchfaces/009-contemporary-digital-rings.qml |  2 +-
 15 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/qml/MainScreen.qml b/qml/MainScreen.qml
index 6a21772..f0199e4 100644
--- a/qml/MainScreen.qml
+++ b/qml/MainScreen.qml
@@ -146,22 +146,22 @@ Item {
 
     Connections {
         target: Lipstick.compositor
-        onDisplayAboutToBeOn: {
+        function onDisplayAboutToBeOn() {
             wallClockAmbientTimeout.stop()
             wallClock.enabled = true
         }
-        onDisplayAboutToBeOff: wallClock.enabled = false
-        onDisplayOn: {
+        function onDisplayAboutToBeOff() { wallClock.enabled = false }
+        function onDisplayOn() {
             grid.animateIndicators()
             if (Lipstick.compositor.ambientEnabled) grid.moveTo(0, 0)
         }
-        onDisplayAmbientChanged: wallpaperAnimation.duration = 300
-        onDisplayAmbientEntered: wallpaperDarkener.opacity = 1
-        onDisplayAmbientLeft: {
+        function onDisplayAmbientChanged() { wallpaperAnimation.duration = 300 }
+        function onDisplayAmbientEntered() { wallpaperDarkener.opacity = 1 }
+        function onDisplayAmbientLeft() {
             wallpaperDarkener.opacity = 0
             if (burnInProtectionManager.enabled) leftIndicator.anchors.verticalCenterOffset = 0
         }
-        onDisplayAmbientUpdate: {
+        function onDisplayAmbientUpdate() {
             // Perform burn in protection
             if (burnInProtectionManager.enabled) {
                 grid.contentX = Math.random()*(burnInProtectionManager.leftOffset + burnInProtectionManager.rightOffset)-burnInProtectionManager.leftOffset
@@ -184,7 +184,7 @@ Item {
 
     Connections {
         target: localeManager
-        onChangesObserverChanged: {
+        function onChangesObserverChanged() {
             var bkp = watchFaceSource.value
             watchFaceSource.value = ""
             watchFaceSource.value = bkp
@@ -276,9 +276,10 @@ Item {
         repeat: false
         onTriggered: Desktop.onAboutToClose()
     }
+
     Connections {
         target: Lipstick.compositor
-        onDisplayOff: lockscreenDelay.start();
+        function onDisplayOff() { lockscreenDelay.start() }
      }
 
 // Wallpaper
diff --git a/qml/misc/BluetoothAgent.qml b/qml/misc/BluetoothAgent.qml
index 153c4f2..0e538d4 100644
--- a/qml/misc/BluetoothAgent.qml
+++ b/qml/misc/BluetoothAgent.qml
@@ -136,7 +136,7 @@ Item {
 
     Connections {
         target: agent
-        onStateChanged: {
+        function onStateChanged() {
             switch(agent.state) {
                 case BluetoothAgent.AuthService:
                     //% "Authorize:"
diff --git a/qml/notifications/NotificationActions.qml b/qml/notifications/NotificationActions.qml
index 825df7c..6182f66 100644
--- a/qml/notifications/NotificationActions.qml
+++ b/qml/notifications/NotificationActions.qml
@@ -77,7 +77,7 @@ Item {
 
     Connections {
         target: panelsGrid
-        onCurrentHorizontalPosChanged: {
+        function onCurrentHorizontalPosChanged() {
             if(forbidBottom)
                 layerStack.pop(layerStack.currentLayer)
             updateTimestamp()
diff --git a/qml/notifications/NotificationIndicator.qml b/qml/notifications/NotificationIndicator.qml
index 8289a0e..2eb784f 100644
--- a/qml/notifications/NotificationIndicator.qml
+++ b/qml/notifications/NotificationIndicator.qml
@@ -135,8 +135,8 @@ Item {
                 notifIndic.visible = false
         }
 
-        onCurrentHorizontalPosChanged: makeVisible()
-        onCurrentVerticalPosChanged: makeVisible()
+        function onCurrentHorizontalPosChanged() { makeVisible() }
+        function onCurrentVerticalPosChanged() { makeVisible() }
     }
 
     NotificationListModel {
diff --git a/qml/notifications/NotificationPreview.qml b/qml/notifications/NotificationPreview.qml
index ddf116f..44b0659 100644
--- a/qml/notifications/NotificationPreview.qml
+++ b/qml/notifications/NotificationPreview.qml
@@ -172,7 +172,7 @@ Item {
 
         Connections {
             target: notificationPreviewPresenter;
-            onNotificationChanged: notificationArea.state = (notificationPreviewPresenter.notification != null) ? "show" : "hide"
+            function onNotificationChanged() { notificationArea.state = (notificationPreviewPresenter.notification != null) ? "show" : "hide" }
         }
     }
 }
diff --git a/qml/notifications/NotificationView.qml b/qml/notifications/NotificationView.qml
index d23a7f1..b6799c3 100644
--- a/qml/notifications/NotificationView.qml
+++ b/qml/notifications/NotificationView.qml
@@ -105,7 +105,7 @@ MouseArea {
 
                 Connections {
                     target: panelsGrid
-                    onCurrentHorizontalPosChanged: updateTimestamp()
+                    function onCurrentHorizontalPosChanged() { updateTimestamp() }
                 }
             }
 
diff --git a/watchfaces/000-default-digital.qml b/watchfaces/000-default-digital.qml
index 06c85b5..719855c 100644
--- a/watchfaces/000-default-digital.qml
+++ b/watchfaces/000-default-digital.qml
@@ -122,7 +122,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             var date = wallClock.time.getDate()
diff --git a/watchfaces/001-words-worte-palabras-mots.qml b/watchfaces/001-words-worte-palabras-mots.qml
index 3e4e747..721be14 100644
--- a/watchfaces/001-words-worte-palabras-mots.qml
+++ b/watchfaces/001-words-worte-palabras-mots.qml
@@ -179,7 +179,7 @@ Item {
 
     Connections {
         target: localeManager
-        onChangesObserverChanged: {
+        function onChangesObserverChanged() {
             timeDisplay.text = Qt.binding(function() { return generateTime(wallClock.time) })
             dateDisplay.text = Qt.binding(function() { return wallClock.time.toLocaleString(Qt.locale(), "<b>ddd</b> d MMM") })
         }
diff --git a/watchfaces/002-analog-70s-classic.qml b/watchfaces/002-analog-70s-classic.qml
index 6913ecb..27003d7 100644
--- a/watchfaces/002-analog-70s-classic.qml
+++ b/watchfaces/002-analog-70s-classic.qml
@@ -323,7 +323,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             var second = wallClock.time.getSeconds()
diff --git a/watchfaces/003-alternative-digital-2.qml b/watchfaces/003-alternative-digital-2.qml
index 886f890..f51a897 100644
--- a/watchfaces/003-alternative-digital-2.qml
+++ b/watchfaces/003-alternative-digital-2.qml
@@ -179,7 +179,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             var second = wallClock.time.getSeconds()
@@ -240,7 +240,7 @@ Item {
 
     Connections {
         target: localeManager
-        onChangesObserverChanged: {
+        function onChangesObserverChanged() {
             hourCanvas.requestPaint()
             minuteCanvas.requestPaint()
             secondCanvas.requestPaint()
diff --git a/watchfaces/004-alternative-scifi.qml b/watchfaces/004-alternative-scifi.qml
index 50543fd..8a8863a 100644
--- a/watchfaces/004-alternative-scifi.qml
+++ b/watchfaces/004-alternative-scifi.qml
@@ -198,7 +198,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             var date = wallClock.time.getDate()
@@ -245,7 +245,7 @@ Item {
 
     Connections {
         target: localeManager
-        onChangesObserverChanged: {
+        function onChangesObserverChanged() {
             hourCanvas.requestPaint()
             minuteCanvas.requestPaint()
             dateCanvas.requestPaint()
diff --git a/watchfaces/005-analog-nordic.qml b/watchfaces/005-analog-nordic.qml
index 2f59a1e..4224e3a 100644
--- a/watchfaces/005-analog-nordic.qml
+++ b/watchfaces/005-analog-nordic.qml
@@ -300,7 +300,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             var second = wallClock.time.getSeconds()
diff --git a/watchfaces/006-analog-50s-americana.qml b/watchfaces/006-analog-50s-americana.qml
index b1a5f7d..cf631f9 100644
--- a/watchfaces/006-analog-50s-americana.qml
+++ b/watchfaces/006-analog-50s-americana.qml
@@ -261,7 +261,7 @@ Item {
 
     Connections {
         target: compositor
-        onDisplayAmbientChanged: {
+        function onDisplayAmbientChanged() {
             minuteHand.requestPaint()
             hourHand.requestPaint()
         }
@@ -269,7 +269,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             var second = wallClock.time.getSeconds()
diff --git a/watchfaces/007-bold-hour-bebas.qml b/watchfaces/007-bold-hour-bebas.qml
index 6da96f0..e8b72ea 100644
--- a/watchfaces/007-bold-hour-bebas.qml
+++ b/watchfaces/007-bold-hour-bebas.qml
@@ -112,7 +112,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()
             if(minuteCircle.minute != minute) {
diff --git a/watchfaces/009-contemporary-digital-rings.qml b/watchfaces/009-contemporary-digital-rings.qml
index ab497ff..171344d 100644
--- a/watchfaces/009-contemporary-digital-rings.qml
+++ b/watchfaces/009-contemporary-digital-rings.qml
@@ -204,7 +204,7 @@ Item {
 
     Connections {
         target: wallClock
-        onTimeChanged: {
+        function onTimeChanged() {
             if (displayAmbient) return
             var hour = wallClock.time.getHours()
             var minute = wallClock.time.getMinutes()