[Merge] lp:~renatofilho/address-book-app/syncevolution-to-buteo into lp:address-book-app

Michael Sheldon michael.sheldon at canonical.com
Mon Sep 28 15:46:27 UTC 2015


Review: Needs Fixing

Couple of small issues added as diff comments, apart from those this look good.

Diff comments:

> 
> === modified file 'src/app/addressbookapp.cpp'
> --- src/app/addressbookapp.cpp	2015-09-23 19:27:41 +0000
> +++ src/app/addressbookapp.cpp	2015-09-23 19:27:42 +0000
> @@ -106,8 +107,9 @@
>        m_withArgs(false)
>  {
>      s_elapsed.start();
> -    setOrganizationName("com.ubuntu.address-book");
> -    setApplicationName("AddressBookApp");
> +    setOrganizationName(SETTINGS_ORGANIZATION_NAME);
> +    setApplicationName(SETTINGS_APP_NAME);
> +    setOrganizationDomain("canonical.com");

Since the other values are #def'd it'd seem to make sense to do the same for 'canonical.com' as well.

>      connect(m_netManager.data(),
>              SIGNAL(onlineStateChanged(bool)),
>              SIGNAL(isOnlineChanged()),
> 
> === modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml'
> --- src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml	2015-09-23 19:27:41 +0000
> +++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml	2015-09-23 19:27:42 +0000
> @@ -53,23 +54,75 @@
>          }
>      }
>  
> +    function contactIsReadyOnly(contact) {

I think this should be "contactIsReadOnly" instead of ReadyOnly.

> +        var sources = sourceModel.contacts
> +        var contactSyncTarget = contact.syncTarget.value(SyncTarget.SyncTarget + 1)
> +
> +        for (var i = 0; i < writableSources.count; i++) {
> +            if (writableSources.get(i).contact.guid.guid === contactSyncTarget) {
> +                return false
> +            }
> +        }
> +        return true
> +    }
> +
> +    function targetIsReadOnly(target) {
> +        if (!target)
> +            return true
> +
> +        var details = target.details(ContactDetail.ExtendedDetail)
> +        for(var d in details) {
> +            if ((details[d].name === "READ-ONLY") && (details[d].data === true)) {
> +                return true
> +            }
> +        }
> +
> +        return false
> +    }
> +
>      property bool isNewContact: contact && contact.contactId === "qtcontacts:::"
>      property real myHeight: sources.currentlyExpanded ? sources.containerHeight + units.gu(6) + label.height : sources.itemHeight + units.gu(6) + label.height
>  
>      detail: root.contact ? contact.detail(ContactDetail.SyncTarget) : null
> -    implicitHeight: root.isNewContact &&  sources.model && (sources.model.contacts.length > 1) ? myHeight : 0
> +    implicitHeight: root.isNewContact &&  sources.model && (sources.model.count > 1) ? myHeight : 0
>  
>      ContactModel {
>          id: sourceModel
>  
>          manager: (typeof(QTCONTACTS_MANAGER_OVERRIDE) !== "undefined") && (QTCONTACTS_MANAGER_OVERRIDE != "") ? QTCONTACTS_MANAGER_OVERRIDE : "galera"
> -        filter:  DetailFilter {
> +        filter: DetailFilter {
>              detail: ContactDetail.Type
>              field: Type.TypeField
>              value: Type.Group
>              matchFlags: DetailFilter.MatchExactly
>          }
>          autoUpdate: false
> +        onContactsChanged: {
> +            if (contacts.length > 0) {
> +                writableSources.reload()
> +                root.changed()
> +            }
> +        }
> +    }
> +
> +    ListModel {
> +        id: writableSources
> +
> +        function reload() {
> +            clear()
> +
> +            // filter out read-only sources
> +            var contacts = sourceModel.contacts
> +            if (contacts.length === 0) {
> +                return
> +            }
> +
> +            for(var i in contacts) {
> +                if (!targetIsReadOnly(contacts[i])) {
> +                    append({'contact': contacts[i]})
> +                }
> +            }
> +        }
>      }
>  
>      Label {


-- 
https://code.launchpad.net/~renatofilho/address-book-app/syncevolution-to-buteo/+merge/266135
Your team Ubuntu Phablet Team is subscribed to branch lp:address-book-app.



More information about the Ubuntu-reviews mailing list