Merge lp:~mardy/ubuntu-system-settings-online-accounts/lp1257028 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan
Status: Merged
Approved by: Ken VanDine
Approved revision: 84
Merged at revision: 84
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/lp1257028
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 110 lines (+29/-25)
5 files modified
src/module/ServiceItem.qml (+24/-18)
src/module/ServiceSwitches.qml (+1/-1)
src/qml/AccountItem.qml (+1/-3)
src/qml/AccountsPage.qml (+2/-2)
src/qml/ProvidersList.qml (+1/-1)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/lp1257028
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+197472@code.launchpad.net

Commit message

Use new iconName property for list items

Also, avoid using the deprecated model roles from accounts-qml-module:
account -> accountHandle
accountService -> accountServiceHandle

Introducing a new Item as root item in the ServiceItem component is needed in
order to hide the Repeater's "model" property, which would otherwise conflict
with the homonymous context property in ServiceSwitches.qml.

Description of the change

Use new iconName property for list items

Also, avoid using the deprecated model roles from accounts-qml-module:
account -> accountHandle
accountService -> accountServiceHandle

Introducing a new Item as root item in the ServiceItem component is needed in
order to hide the Repeater's "model" property, which would otherwise conflict
with the homonymous context property in ServiceSwitches.qml.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/module/ServiceItem.qml'
2--- src/module/ServiceItem.qml 2013-09-25 08:13:59 +0000
3+++ src/module/ServiceItem.qml 2013-12-03 08:25:53 +0000
4@@ -21,26 +21,32 @@
5 import Ubuntu.Components.ListItems 0.1 as ListItem
6 import Ubuntu.OnlineAccounts 0.1
7
8-Repeater {
9+Item {
10 property variant accountServiceHandle
11
12- resources: AccountService {
13- id: accountService
14- objectHandle: accountServiceHandle
15- }
16-
17- model: ApplicationModel {
18- service: accountService.service.id
19- }
20-
21- delegate: ListItem.Standard {
22- text: model.displayName
23- icon: "image://theme/" + model.iconName
24- control: Switch {
25- checked: accountService.serviceEnabled
26- onCheckedChanged: {
27- if (checked != accountService.serviceEnabled) {
28- accountService.updateServiceEnabled(checked)
29+ anchors.left: parent.left
30+ anchors.right: parent.right
31+ height: childrenRect.height
32+
33+ Repeater {
34+ resources: AccountService {
35+ id: accountService
36+ objectHandle: accountServiceHandle
37+ }
38+
39+ model: ApplicationModel {
40+ service: accountService.service.id
41+ }
42+
43+ delegate: ListItem.Standard {
44+ text: model.displayName
45+ iconName: model.iconName
46+ control: Switch {
47+ checked: accountService.serviceEnabled
48+ onCheckedChanged: {
49+ if (checked != accountService.serviceEnabled) {
50+ accountService.updateServiceEnabled(checked)
51+ }
52 }
53 }
54 }
55
56=== modified file 'src/module/ServiceSwitches.qml'
57--- src/module/ServiceSwitches.qml 2013-06-24 16:25:20 +0000
58+++ src/module/ServiceSwitches.qml 2013-12-03 08:25:53 +0000
59@@ -42,7 +42,7 @@
60 Repeater {
61 model: accountServices
62 delegate: ServiceItem {
63- accountServiceHandle: accountService
64+ accountServiceHandle: model.accountServiceHandle
65 }
66 }
67 }
68
69=== modified file 'src/qml/AccountItem.qml'
70--- src/qml/AccountItem.qml 2013-10-17 11:08:57 +0000
71+++ src/qml/AccountItem.qml 2013-12-03 08:25:53 +0000
72@@ -27,9 +27,7 @@
73 property variant __editPage: null
74 property bool running: false
75
76- text: providerName
77- subText: displayName
78- icon: "image://theme/" + globalService.provider.iconName
79+ iconName: globalService.provider.iconName
80 progression: true
81 opacity: globalService.enabled ? 1 : 0.5
82
83
84=== modified file 'src/qml/AccountsPage.qml'
85--- src/qml/AccountsPage.qml 2013-10-17 11:08:57 +0000
86+++ src/qml/AccountsPage.qml 2013-12-03 08:25:53 +0000
87@@ -41,8 +41,8 @@
88 ListView.delayRemove: running
89 text: providerName
90 subText: displayName
91- accountHandle: account
92- globalServiceHandle: accountService
93+ accountHandle: model.accountHandle
94+ globalServiceHandle: accountServiceHandle
95 }
96 }
97
98
99=== modified file 'src/qml/ProvidersList.qml'
100--- src/qml/ProvidersList.qml 2013-10-17 11:08:57 +0000
101+++ src/qml/ProvidersList.qml 2013-12-03 08:25:53 +0000
102@@ -39,7 +39,7 @@
103 delegate: ListItem.Standard {
104 text: displayName
105 enabled: !isSingleAccount || hasNoAccounts(providerId)
106- icon: "image://theme/" + iconName
107+ iconName: model.iconName
108 progression: true
109 onClicked: root.providerClicked(providerId)
110 }

Subscribers

People subscribed via source and target branches