Merge lp:~renatofilho/address-book-app/bug-fixes into lp:~phablet-team/address-book-app/staging

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 233
Merged at revision: 230
Proposed branch: lp:~renatofilho/address-book-app/bug-fixes
Merge into: lp:~phablet-team/address-book-app/staging
Diff against target: 280 lines (+108/-35)
7 files modified
src/imports/CMakeLists.txt (+1/-0)
src/imports/ContactEdit/ContactDetailAvatarEditor.qml (+2/-1)
src/imports/ContactList/ContactListPage.qml (+9/-4)
src/imports/ContactView/ContactDetailAvatarView.qml (+30/-2)
src/imports/ContentHubProxy.qml (+41/-0)
src/imports/MainWindow.qml (+16/-23)
src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml (+9/-5)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/bug-fixes
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+228407@code.launchpad.net

Commit message

Used empty context for cell phones. To avoid problems with google sync.

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

PASSED: Continuous integration, rev:230
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/253/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2536
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2044
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/253
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/253/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2683
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3779
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3779/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10479
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1712
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2297
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2297/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/253/rebuild

review: Approve (continuous-integration)
231. By Renato Araujo Oliveira Filho

Fixed avatar icon image update on contact view page after edit it.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:231
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/254/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2537
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2045
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/254
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/254
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/254/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/254
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2684
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3780
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3780/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10480
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1713
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2298
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2298/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/254/rebuild

review: Approve (continuous-integration)
232. By Renato Araujo Oliveira Filho

Load content hub async.
Fixed content hub import mode.

233. By Renato Araujo Oliveira Filho

Fixed content hub export. (pick mode)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:233
http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-ci/255/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2540
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2048
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-amd64-ci/255
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/255
        deb: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-armhf-ci/255/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/phablet-team-address-book-app-staging-utopic-i386-ci/255
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2687
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3783
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3783/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10483
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1716
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2301
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2301/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/phablet-team-address-book-app-staging-ci/255/rebuild

review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/CMakeLists.txt'
2--- src/imports/CMakeLists.txt 2014-07-02 17:42:04 +0000
3+++ src/imports/CMakeLists.txt 2014-07-27 20:37:31 +0000
4@@ -1,6 +1,7 @@
5 project(imports)
6
7 set(ADDRESS_BOOK_APP_QMLS
8+ ContentHubProxy.qml
9 MainWindow.qml
10 )
11
12
13=== modified file 'src/imports/ContactEdit/ContactDetailAvatarEditor.qml'
14--- src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2014-07-08 23:19:01 +0000
15+++ src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2014-07-27 20:37:31 +0000
16@@ -30,8 +30,9 @@
17 }
18
19 function save() {
20+ // create the avatar detail
21 if (avatarImage.source != root.defaultAvatar) {
22- if (root.detail && (root.detail === avatarImage.source)) {
23+ if (root.detail && (root.detail.imageUrl === avatarImage.source)) {
24 return false
25 } else {
26 // create the avatar detail
27
28=== modified file 'src/imports/ContactList/ContactListPage.qml'
29--- src/imports/ContactList/ContactListPage.qml 2014-07-22 08:12:11 +0000
30+++ src/imports/ContactList/ContactListPage.qml 2014-07-27 20:37:31 +0000
31@@ -118,8 +118,9 @@
32 }
33 }
34
35- function startPickMode(isSingleSelection)
36+ function startPickMode(isSingleSelection, activeTransfer)
37 {
38+ contentHubTransfer = activeTransfer
39 pickMode = true
40 pickMultipleContacts = !isSingleSelection
41 contactList.startSelection()
42@@ -304,9 +305,11 @@
43 onSelectionCanceled: {
44 if (pickMode) {
45 if (contentHubTransfer) {
46- contentHubTransfer.state = ContentTransfer.Aborted
47+ contentHubTransfer.state = ContentHub.ContentTransfer.Aborted
48 }
49- pageStack.pop()
50+ pickMode = false
51+ contentHubTransfer = null
52+ state = ""
53 application.returnVcard("")
54 }
55 }
56@@ -609,7 +612,9 @@
57 } else {
58 console.error("Fail to export contacts:" + error)
59 }
60- pageStack.pop()
61+ activeTransfer = null
62+ pickMode = false
63+ state = ""
64 application.returnVcard(url)
65 }
66 }
67
68=== modified file 'src/imports/ContactView/ContactDetailAvatarView.qml'
69--- src/imports/ContactView/ContactDetailAvatarView.qml 2014-07-10 22:48:31 +0000
70+++ src/imports/ContactView/ContactDetailAvatarView.qml 2014-07-27 20:37:31 +0000
71@@ -28,9 +28,37 @@
72 implicitWidth: units.gu(10)
73
74 Connections {
75- target: root.contact ? root.contact.detail(ContactDetail.Avatar) : null
76+ id: connections
77+
78+ function updateTarget()
79+ {
80+ if (root.contact) {
81+ var avatarDetail = root.contact.detail(ContactDetail.Avatar)
82+ if (avatarDetail) {
83+ return avatarDetail
84+ } else {
85+ return root.contact
86+ }
87+ }
88+ return null
89+ }
90+
91+ target: updateTarget()
92 ignoreUnknownSignals: true
93- onDetailChanged: avatar.reload()
94+ onContactChanged: {
95+ var avatarDetail = root.contact.detail(ContactDetail.Avatar)
96+ if (avatarDetail) {
97+ avatar.reload()
98+ connections.target = avatarDetail
99+ }
100+ }
101+ onDetailChanged: {
102+ var avatarDetail = root.contact.detail(ContactDetail.Avatar)
103+ if (avatarDetail === null) {
104+ connections.target = root.contact
105+ }
106+ avatar.reload()
107+ }
108 }
109
110 ContactsUI.ContactAvatar {
111
112=== added file 'src/imports/ContentHubProxy.qml'
113--- src/imports/ContentHubProxy.qml 1970-01-01 00:00:00 +0000
114+++ src/imports/ContentHubProxy.qml 2014-07-27 20:37:31 +0000
115@@ -0,0 +1,41 @@
116+/*
117+ * Copyright (C) 2012-2013 Canonical, Ltd.
118+ *
119+ * This program is free software; you can redistribute it and/or modify
120+ * it under the terms of the GNU General Public License as published by
121+ * the Free Software Foundation; version 3.
122+ *
123+ * This program is distributed in the hope that it will be useful,
124+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
125+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
126+ * GNU General Public License for more details.
127+ *
128+ * You should have received a copy of the GNU General Public License
129+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
130+ */
131+
132+import QtQuick 2.2
133+import Ubuntu.Content 0.1 as ContentHub
134+
135+QtObject {
136+ property QtObject pageStack: null
137+ property list<QtObject> objects: [
138+ Connections {
139+ target: ContentHub.ContentHub
140+ onExportRequested: {
141+ // enter in pick mode
142+ console.debug("Transferrrrrrr>" + transfer)
143+ pageStack.contactListPage.startPickMode(false, transfer)
144+ }
145+ onImportRequested: {
146+ if (transfer.state === ContentHub.ContentTransfer.Charged) {
147+ var urls = []
148+ for(var i=0; i < transfer.items.length; i++) {
149+ urls.push(transfer.items[i].url)
150+ }
151+ pageStack.contactListPage.importContact(urls)
152+ }
153+ }
154+ }
155+ ]
156+}
157
158=== modified file 'src/imports/MainWindow.qml'
159--- src/imports/MainWindow.qml 2014-07-16 23:14:44 +0000
160+++ src/imports/MainWindow.qml 2014-07-27 20:37:31 +0000
161@@ -15,10 +15,9 @@
162 */
163
164 import QtQuick 2.2
165-import QtContacts 5.0
166-import Ubuntu.Components 0.1
167-import Ubuntu.Components.Popups 0.1 as Popups
168-import Ubuntu.Content 0.1 as ContentHub
169+import Ubuntu.Components 1.0
170+import Ubuntu.Components.Popups 1.0 as Popups
171+
172
173 MainView {
174 id: mainWindow
175@@ -62,7 +61,7 @@
176 {
177 mainStack.resetStack()
178 if (mainStack.contactListPage) {
179- mainStack.contactListPage.startPickMode(single == "true")
180+ mainStack.contactListPage.startPickMode(single == "true", null)
181 }
182 }
183
184@@ -102,6 +101,14 @@
185 }
186 }
187
188+ onContactListPageChanged: {
189+ if (contentHubLoader.status === Loader.Ready) {
190+ contentHubLoader.item.pageStack = mainStack
191+ } else {
192+ contentHubLoader.setSource(Qt.resolvedUrl("ContentHubProxy.qml"), {"pageStack": mainStack})
193+ }
194+ }
195+
196 anchors.fill: parent
197 }
198
199@@ -138,26 +145,12 @@
200 }
201 }
202
203- Connections {
204- target: ContentHub.ContentHub
205- onExportRequested: {
206- // enter in pick mode
207- mainStack.push(Qt.createComponent("ContactList/ContactListPage.qml"),
208- {pickMode: true,
209- contentHubTransfer: transfer})
210- }
211- onImportRequested: {
212- if (transfer.state === ContentHub.ContentTransfer.Charged) {
213- var urls = []
214- for(var i=0; i < transfer.items.length; i++) {
215- urls.push(transfer.items[i].url)
216- }
217- mainStack.importContactRequested(urls)
218- }
219- }
220+ Loader {
221+ id: contentHubLoader
222+
223+ asynchronous: true
224 }
225
226-
227 // If application was called from uri handler and lost the focus reset the app to normal state
228 onAppActiveChanged: {
229 if (!appActive && mainStack.contactListPage) {
230
231=== modified file 'src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml'
232--- src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml 2014-07-08 19:23:05 +0000
233+++ src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml 2014-07-27 20:37:31 +0000
234@@ -41,9 +41,11 @@
235 } else if (contexts.indexOf(QtContacts.ContactDetail.ContextOther) > -1) {
236 return 4
237 } else {
238- // phone without context is and voice type is other
239+ // phone without context and voice type is other
240 if (subTypes && subTypes.indexOf(QtContacts.PhoneNumber.Voice) > -1) {
241 return 4
242+ } else if (subTypes && subTypes.indexOf(QtContacts.PhoneNumber.Mobile) > -1) {
243+ return 2
244 } else {
245 return 2 // Default value is "Mobile"
246 }
247@@ -59,11 +61,11 @@
248 return false
249 }
250
251- if (listA.length != listB.length) {
252+ if (listA.length !== listB.length) {
253 return false
254 }
255 for(var i=0; i < listA.length; i++) {
256- if (listA[i] != listB[i]) {
257+ if (listA[i] !== listB[i]) {
258 return false
259 }
260 }
261@@ -79,7 +81,9 @@
262 var newSubTypes = []
263 var newContext = []
264
265- newContext.push(modelData.context)
266+ if (modelData.context !== -1) {
267+ newContext.push(modelData.context)
268+ }
269 newSubTypes.push(modelData.subType)
270
271 var changed = false
272@@ -101,7 +105,7 @@
273 append({"value": "Work", "label": i18n.dtr("address-book-app", "Work"), "icon": null,
274 "context": QtContacts.ContactDetail.ContextWork, "subType": QtContacts.PhoneNumber.Voice })
275 append({"value": "Mobile", "label": i18n.dtr("address-book-app", "Mobile"), "icon": null,
276- "context": QtContacts.ContactDetail.ContextHome, "subType": QtContacts.PhoneNumber.Mobile })
277+ "context": -1, "subType": QtContacts.PhoneNumber.Mobile })
278 append({"value": "Mobile-Work", "label": i18n.dtr("address-book-app", "Work Mobile"), "icon": null,
279 "context": QtContacts.ContactDetail.ContextWork, "subType": QtContacts.PhoneNumber.Mobile })
280 append({"value": "Other", "label": i18n.dtr("address-book-app", "Other"), "icon": null,

Subscribers

People subscribed via source and target branches