Merge lp:~unity-api-team/unity8/lp-1434379-gps-overactive into lp:unity8

Proposed by Pete Woods
Status: Merged
Approved by: Michał Sawicz
Approved revision: no longer in the source branch.
Merged at revision: 1723
Proposed branch: lp:~unity-api-team/unity8/lp-1434379-gps-overactive
Merge into: lp:unity8
Diff against target: 33 lines (+2/-3)
2 files modified
qml/Dash/Dash.qml (+1/-1)
qml/Dash/GenericScopeView.qml (+1/-2)
To merge this branch: bzr merge lp:~unity-api-team/unity8/lp-1434379-gps-overactive
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Approve
Review via email: mp+255075@code.launchpad.net

Commit message

GPS only goes active when the Dash is in the foreground

Description of the change

GPS only goes active when the Dash is in the foreground

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Hmmm, does this mean that when going back to the dash it will either show empty (because no scope was active) or the backend will retrigger a search (because it wehnt from inactive to active)?

Revision history for this message
Michał Sawicz (saviq) wrote :

There's another instance that probably needs this:

qml/Dash/Dash.qml:180: property: "isActive"
qml/Dash/Dash.qml-181- value: bottomEdgeController.progress === 1
qml/Dash/Dash.qml-182- }

You will also need to tweak those tests to boot:

tests/qmltests/Dash/tst_DashContent.qml:229: function test_is_active(data) {

tests/qmltests/Dash/tst_GenericScopeView.qml:112: function test_isActive() {

review: Needs Fixing
Revision history for this message
Michał Sawicz (saviq) wrote :

> Hmmm, does this mean that when going back to the dash it will either show empty (because no scope was active) or the backend will retrigger a search (because it wehnt from inactive to active)?

It will retrigger on focus.

Revision history for this message
Albert Astals Cid (aacid) wrote :

That didn't happen before, did it? Is something we want?

Revision history for this message
Michał Sawicz (saviq) wrote :

> That didn't happen before, did it? Is something we want?

It did happen before, just it might have happened before you typed your
passcode in. And regardless whether you did. So it kicked in even when
you got a text, or when you just woke up the phone to see the clock.

Now it will only happen when you actually focused the dash.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
dobey (dobey) wrote :

I've made the two code changes requested by Saviq. I don't understand what should be changed in the mentioned tests though. These two tests still pass, and I don't think Qt.application.active is writable.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

About Qt.application.active:
"Deprecated, use Qt.application.state == Qt.ApplicationActive instead."

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> About Qt.application.active:
> "Deprecated, use Qt.application.state == Qt.ApplicationActive instead."

Other than that, it looks ok to me.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

> I've made the two code changes requested by Saviq. I don't understand what
> should be changed in the mentioned tests though. These two tests still pass,
> and I don't think Qt.application.active is writable.

Indeed, we'd need to build a way into our QPA plugin to allow overriding that.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1706. By Pete Woods

Only have scopes active when the app is focused

1707. By Pete Woods

Respond to Daniel's comments

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Dash/Dash.qml'
2--- qml/Dash/Dash.qml 2015-02-17 08:26:20 +0000
3+++ qml/Dash/Dash.qml 2015-04-08 07:52:07 +0000
4@@ -178,7 +178,7 @@
5 Binding {
6 target: scopesList.scope
7 property: "isActive"
8- value: bottomEdgeController.progress === 1
9+ value: bottomEdgeController.progress === 1 && (Qt.application.state == Qt.ApplicationActive)
10 }
11
12 Connections {
13
14=== modified file 'qml/Dash/GenericScopeView.qml'
15--- qml/Dash/GenericScopeView.qml 2015-03-13 10:07:57 +0000
16+++ qml/Dash/GenericScopeView.qml 2015-04-08 07:52:07 +0000
17@@ -19,7 +19,6 @@
18 import Utils 0.1
19 import Unity 0.2
20 import Dash 0.1
21-import Powerd 0.1
22 import "../Components"
23 import "../Components/ListItems" as ListItems
24
25@@ -105,7 +104,7 @@
26 Binding {
27 target: scope
28 property: "isActive"
29- value: isCurrent && !subPageLoader.open && (Powerd.status === Powerd.On)
30+ value: isCurrent && !subPageLoader.open && (Qt.application.state == Qt.ApplicationActive)
31 }
32
33 UnitySortFilterProxyModel {

Subscribers

People subscribed via source and target branches