[Merge] lp:~renatofilho/address-book-app/syncevolution-to-buteo into lp:address-book-app
Michael Sheldon
michael.sheldon at canonical.com
Tue Sep 29 23:44:16 UTC 2015
Review: Needs Fixing
It looks like you you've renamed the call to the contactIsReadyOnly function, but haven't actually renamed the function itself.
Diff comments:
>
> === modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml'
> --- src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml 2015-09-29 19:04:05 +0000
> +++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailSyncTargetEditor.qml 2015-09-29 19:04:05 +0000
> @@ -53,23 +54,75 @@
> }
> }
>
> + function contactIsReadyOnly(contact) {
Also needs renaming
> + 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