Merge lp:~boiko/dialer-app/use_history_contact_info into lp:dialer-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 269
Merged at revision: 269
Proposed branch: lp:~boiko/dialer-app/use_history_contact_info
Merge into: lp:dialer-app
Diff against target: 157 lines (+27/-31)
3 files modified
src/qml/DialerPage/KeypadEntry.qml (+1/-1)
src/qml/HistoryPage/HistoryDelegate.qml (+23/-28)
src/qml/HistoryPage/HistoryPage.qml (+3/-2)
To merge this branch: bzr merge lp:~boiko/dialer-app/use_history_contact_info
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+233861@code.launchpad.net

Commit message

Use the contact info exposed in the history models instead of having multiple instances of the contact watcher.

Description of the change

Use the contact info exposed in the history models instead of having multiple instances of the contact watcher.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
Yes: https://code.launchpad.net/~boiko/history-service/keep_models_sorted/+merge/234024

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed UI labels, did you update the pot file?
N/A

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
N/A

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

Fix loading the details view.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
267. By Gustavo Pichorim Boiko

Get rid of a warning.

268. By Gustavo Pichorim Boiko

Disable focus on the text input to avoid having the OSK to show up.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) :
review: Needs Fixing
269. By Gustavo Pichorim Boiko

Use the phone number property that already checks for participant validity.

Revision history for this message
Gustavo Pichorim Boiko (boiko) :
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator? YES

Did CI run pass? YES

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut? YES

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/DialerPage/KeypadEntry.qml'
2--- src/qml/DialerPage/KeypadEntry.qml 2014-07-31 14:59:34 +0000
3+++ src/qml/DialerPage/KeypadEntry.qml 2014-09-12 21:08:50 +0000
4@@ -68,7 +68,7 @@
5 font.pixelSize: maximumFontSize
6 font.family: "Ubuntu"
7 color: UbuntuColors.darkGrey
8- focus: true
9+ focus: false
10 cursorVisible: true
11 clip: true
12 defaultRegion: PhoneUtils.defaultRegion
13
14=== modified file 'src/qml/HistoryPage/HistoryDelegate.qml'
15--- src/qml/HistoryPage/HistoryDelegate.qml 2014-08-20 18:53:45 +0000
16+++ src/qml/HistoryPage/HistoryDelegate.qml 2014-09-12 21:08:50 +0000
17@@ -29,11 +29,15 @@
18 ListItemWithActions {
19 id: historyDelegate
20
21+ readonly property var participant: model.participants && model.participants[0] ? model.participants[0] : {}
22 readonly property bool incoming: model.senderId !== "self"
23- readonly property bool unknownContact: contactWatcher.contactId === ""
24- readonly property alias phoneNumber: contactWatcher.phoneNumber
25- readonly property alias contactId: contactWatcher.contactId
26- readonly property alias interactive: contactWatcher.interactive
27+ readonly property bool unknownContact: contactId === ""
28+ readonly property string phoneNumber: participant.phoneNumber ? participant.phoneNumber : ""
29+ readonly property string contactId: participant.contactId ? participant.contactId : ""
30+ readonly property bool interactive: participant.phoneNumber &&
31+ participant.phoneNumber !== "" &&
32+ participant.phoneNumber !== "x-ofono-private" &&
33+ participant.phoneNumber !== "x-ofono-unknown"
34
35 property string phoneNumberSubTypeLabel: ""
36 property bool isFirst: false
37@@ -42,14 +46,14 @@
38
39 function activate() {
40 // ignore private and unknown numbers
41- if (model.participants[0] == "x-ofono-private" || model.participants[0] == "x-ofono-unknown") {
42+ if (!interactive) {
43 return;
44 }
45
46 if (fullView && mainView.account) {
47- mainView.call(model.participants[0], mainView.account.accountId);
48+ mainView.call(participant.phoneNumber, mainView.account.accountId);
49 } else {
50- mainView.populateDialpad(model.participants[0], mainView.account ? mainView.account.accountId : "");
51+ mainView.populateDialpad(participant.phoneNumber, mainView.account ? mainView.account.accountId : "");
52 }
53 }
54
55@@ -94,8 +98,8 @@
56 id: helper
57
58 function updateSubTypeLabel() {
59- var subLabel = contactWatcher.isUnknown
60- if (model.participants && model.participants[0]) {
61+ var subLabel = "";
62+ if (phoneNumber !== "") {
63 var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail))
64 if (typeInfo) {
65 subLabel = typeInfo.label
66@@ -106,19 +110,10 @@
67
68 Component.onCompleted: updateSubTypeLabel()
69
70- ContactWatcher {
71- id: contactWatcher
72- // FIXME: handle conf calls
73- phoneNumber: model.participants[0]
74- onPhoneNumberContextsChanged: helper.updateSubTypeLabel()
75- onPhoneNumberSubTypesChanged: helper.updateSubTypeLabel()
76- onIsUnknownChanged: helper.updateSubTypeLabel()
77- }
78-
79 PhoneNumber {
80 id: phoneDetail
81- contexts: contactWatcher.phoneNumberContexts
82- subTypes: contactWatcher.phoneNumberSubTypes
83+ contexts: participant.phoneContexts ? participant.phoneContexts : []
84+ subTypes: participant.phoneSubTypes ? participant.phoneSubTypes : []
85 }
86
87 ContactDetailPhoneNumberTypeModel {
88@@ -150,8 +145,8 @@
89 bottom: parent.bottom
90 }
91 width: height
92- fallbackAvatarUrl: contactWatcher.avatar === "" ? "image://theme/stock_contact" : contactWatcher.avatar
93- fallbackDisplayName: contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber
94+ fallbackAvatarUrl: (participant.avatar && participant.avatar !== "") ? participant.avatar : "image://theme/stock_contact"
95+ fallbackDisplayName: (participant.alias && participant.alias !== "") ? participant.alias : phoneNumber
96 showAvatarPicture: (fallbackAvatarUrl != "image://theme/stock_contact") || (initials.length === 0)
97 }
98
99@@ -169,14 +164,14 @@
100 verticalAlignment: Text.AlignTop
101 fontSize: "medium"
102 text: {
103- if (contactWatcher.phoneNumber == "x-ofono-private") {
104+ if (participant.phoneNumber == "x-ofono-private") {
105 return i18n.tr("Private number")
106- } else if (contactWatcher.phoneNumber == "x-ofono-unknown") {
107+ } else if (participant.phoneNumber == "x-ofono-unknown") {
108 return i18n.tr("Unknown number")
109- } else if (contactWatcher.alias != "") {
110- return contactWatcher.alias
111+ } else if (participant.alias && participant.alias !== "") {
112+ return participant.alias
113 }
114- return PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber)
115+ return PhoneUtils.PhoneUtils.format(participant.phoneNumber)
116 }
117 elide: Text.ElideRight
118 color: UbuntuColors.lightAubergine
119@@ -220,7 +215,7 @@
120 fontSize: "small"
121 // FIXME: handle conference call
122 text: phoneNumberSubTypeLabel
123- visible: interactive && !contactWatcher.isUnknown // non-interactive entries are calls from unknown or private numbers
124+ visible: interactive && !unknownContact
125 }
126
127 // time and duration on the right side of the delegate
128
129=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
130--- src/qml/HistoryPage/HistoryPage.qml 2014-08-27 20:07:54 +0000
131+++ src/qml/HistoryPage/HistoryPage.qml 2014-09-12 21:08:50 +0000
132@@ -103,7 +103,7 @@
133 visible: false
134 property variant model: Item {
135 property string senderId: "dummy"
136- property variant participants: ["dummy"]
137+ property variant participants: [ {phoneNumber:"dummy"} ]
138 }
139 }
140
141@@ -152,6 +152,7 @@
142 sortOrder: HistorySort.DescendingOrder
143 }
144 filter: emptyFilter
145+ matchContacts: true
146 }
147
148 MultipleSelectionListView {
149@@ -322,7 +323,7 @@
150 text: i18n.tr("Details")
151 onTriggered: {
152 pageStack.push(Qt.resolvedUrl("HistoryDetailsPage.qml"),
153- { phoneNumber: participants[0],
154+ { phoneNumber: participants[0].phoneNumber,
155 events: model.events,
156 eventModel: historyEventModel})
157 }

Subscribers

People subscribed via source and target branches