Merge lp:~mardy/ubuntu-system-settings-online-accounts/single-prompt-1552762 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan
Status: Merged
Approved by: David Barth
Approved revision: 329
Merged at revision: 336
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/single-prompt-1552762
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 33 lines (+3/-6)
1 file modified
online-accounts-ui/qml/ProviderRequest.qml (+3/-6)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/single-prompt-1552762
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Online Accounts Pending
Review via email: mp+288071@code.launchpad.net

Commit message

ProviderRequest: fix single account handling in authorization page

The canCreateAccount() function was being incorrectly used as a property in one part of the code. Given that the function is indeed suitable for being turned into a property, we use it as such.

Description of the change

ProviderRequest: fix single account handling in authorization page

The canCreateAccount() function was being incorrectly used as a property in one part of the code. Given that the function is indeed suitable for being turned into a property, we use it as such.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'online-accounts-ui/qml/ProviderRequest.qml'
2--- online-accounts-ui/qml/ProviderRequest.qml 2015-11-02 07:28:44 +0000
3+++ online-accounts-ui/qml/ProviderRequest.qml 2016-03-04 09:51:13 +0000
4@@ -38,7 +38,7 @@
5
6 Component.onCompleted: {
7 i18n.domain = "ubuntu-system-settings-online-accounts"
8- if (accessModel.count === 0 && !accessModel.canCreateAccounts()) {
9+ if (accessModel.count === 0 && !accessModel.canCreateAccounts) {
10 /* No accounts to authorize */
11 denied()
12 return
13@@ -63,7 +63,7 @@
14 id: loader
15 anchors.fill: parent
16 active: false
17- sourceComponent: ((accessModel.count == 0 && accessModel.canCreateAccounts()) ||
18+ sourceComponent: ((accessModel.count == 0 && accessModel.canCreateAccounts) ||
19 applicationInfo.id === "system-settings") ?
20 accountCreationPage : authorizationPage
21 onLoaded: {
22@@ -96,10 +96,7 @@
23 accountModel: accountsModel
24 applicationId: applicationInfo.id
25
26- function canCreateAccounts() {
27- if (!providerInfo.isSingleAccount) return true
28- return accountsModel.count === 0
29- }
30+ property bool canCreateAccounts: !providerInfo.isSingleAccount || accountsModel.count === 0
31 }
32
33 Component {

Subscribers

People subscribed via source and target branches