Merge lp:~renatofilho/address-book-app/release-2014-07-29 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 231
Merged at revision: 259
Proposed branch: lp:~renatofilho/address-book-app/release-2014-07-29
Merge into: lp:address-book-app
Diff against target: 301 lines (+110/-36)
8 files modified
src/app/imagescalethread.cpp (+2/-1)
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/release-2014-07-29
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+228588@code.launchpad.net

Commit message

Used empty context for cell phones details.
Fixed content hub import and export.
Fixed avatar view on contact details.

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

PASSED: Continuous integration, rev:231
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/649/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-amd64-ci/102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/102
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/102/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-i386-ci/102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2620
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2103
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2751
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3863
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3863/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10573
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1757
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2356
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2356/artifact/work/output/*zip*/output.zip

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

Subscribers

People subscribed via source and target branches