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
=== modified file 'src/qml/DialerPage/KeypadEntry.qml'
--- src/qml/DialerPage/KeypadEntry.qml 2014-07-31 14:59:34 +0000
+++ src/qml/DialerPage/KeypadEntry.qml 2014-09-12 21:08:50 +0000
@@ -68,7 +68,7 @@
68 font.pixelSize: maximumFontSize68 font.pixelSize: maximumFontSize
69 font.family: "Ubuntu"69 font.family: "Ubuntu"
70 color: UbuntuColors.darkGrey70 color: UbuntuColors.darkGrey
71 focus: true71 focus: false
72 cursorVisible: true72 cursorVisible: true
73 clip: true73 clip: true
74 defaultRegion: PhoneUtils.defaultRegion74 defaultRegion: PhoneUtils.defaultRegion
7575
=== modified file 'src/qml/HistoryPage/HistoryDelegate.qml'
--- src/qml/HistoryPage/HistoryDelegate.qml 2014-08-20 18:53:45 +0000
+++ src/qml/HistoryPage/HistoryDelegate.qml 2014-09-12 21:08:50 +0000
@@ -29,11 +29,15 @@
29ListItemWithActions {29ListItemWithActions {
30 id: historyDelegate30 id: historyDelegate
3131
32 readonly property var participant: model.participants && model.participants[0] ? model.participants[0] : {}
32 readonly property bool incoming: model.senderId !== "self"33 readonly property bool incoming: model.senderId !== "self"
33 readonly property bool unknownContact: contactWatcher.contactId === ""34 readonly property bool unknownContact: contactId === ""
34 readonly property alias phoneNumber: contactWatcher.phoneNumber35 readonly property string phoneNumber: participant.phoneNumber ? participant.phoneNumber : ""
35 readonly property alias contactId: contactWatcher.contactId36 readonly property string contactId: participant.contactId ? participant.contactId : ""
36 readonly property alias interactive: contactWatcher.interactive37 readonly property bool interactive: participant.phoneNumber &&
38 participant.phoneNumber !== "" &&
39 participant.phoneNumber !== "x-ofono-private" &&
40 participant.phoneNumber !== "x-ofono-unknown"
3741
38 property string phoneNumberSubTypeLabel: ""42 property string phoneNumberSubTypeLabel: ""
39 property bool isFirst: false43 property bool isFirst: false
@@ -42,14 +46,14 @@
4246
43 function activate() {47 function activate() {
44 // ignore private and unknown numbers48 // ignore private and unknown numbers
45 if (model.participants[0] == "x-ofono-private" || model.participants[0] == "x-ofono-unknown") {49 if (!interactive) {
46 return;50 return;
47 }51 }
4852
49 if (fullView && mainView.account) {53 if (fullView && mainView.account) {
50 mainView.call(model.participants[0], mainView.account.accountId);54 mainView.call(participant.phoneNumber, mainView.account.accountId);
51 } else {55 } else {
52 mainView.populateDialpad(model.participants[0], mainView.account ? mainView.account.accountId : "");56 mainView.populateDialpad(participant.phoneNumber, mainView.account ? mainView.account.accountId : "");
53 }57 }
54 }58 }
5559
@@ -94,8 +98,8 @@
94 id: helper98 id: helper
9599
96 function updateSubTypeLabel() {100 function updateSubTypeLabel() {
97 var subLabel = contactWatcher.isUnknown101 var subLabel = "";
98 if (model.participants && model.participants[0]) {102 if (phoneNumber !== "") {
99 var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail))103 var typeInfo = phoneTypeModel.get(phoneTypeModel.getTypeIndex(phoneDetail))
100 if (typeInfo) {104 if (typeInfo) {
101 subLabel = typeInfo.label105 subLabel = typeInfo.label
@@ -106,19 +110,10 @@
106110
107 Component.onCompleted: updateSubTypeLabel()111 Component.onCompleted: updateSubTypeLabel()
108112
109 ContactWatcher {
110 id: contactWatcher
111 // FIXME: handle conf calls
112 phoneNumber: model.participants[0]
113 onPhoneNumberContextsChanged: helper.updateSubTypeLabel()
114 onPhoneNumberSubTypesChanged: helper.updateSubTypeLabel()
115 onIsUnknownChanged: helper.updateSubTypeLabel()
116 }
117
118 PhoneNumber {113 PhoneNumber {
119 id: phoneDetail114 id: phoneDetail
120 contexts: contactWatcher.phoneNumberContexts115 contexts: participant.phoneContexts ? participant.phoneContexts : []
121 subTypes: contactWatcher.phoneNumberSubTypes116 subTypes: participant.phoneSubTypes ? participant.phoneSubTypes : []
122 }117 }
123118
124 ContactDetailPhoneNumberTypeModel {119 ContactDetailPhoneNumberTypeModel {
@@ -150,8 +145,8 @@
150 bottom: parent.bottom145 bottom: parent.bottom
151 }146 }
152 width: height147 width: height
153 fallbackAvatarUrl: contactWatcher.avatar === "" ? "image://theme/stock_contact" : contactWatcher.avatar148 fallbackAvatarUrl: (participant.avatar && participant.avatar !== "") ? participant.avatar : "image://theme/stock_contact"
154 fallbackDisplayName: contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber149 fallbackDisplayName: (participant.alias && participant.alias !== "") ? participant.alias : phoneNumber
155 showAvatarPicture: (fallbackAvatarUrl != "image://theme/stock_contact") || (initials.length === 0)150 showAvatarPicture: (fallbackAvatarUrl != "image://theme/stock_contact") || (initials.length === 0)
156 }151 }
157152
@@ -169,14 +164,14 @@
169 verticalAlignment: Text.AlignTop164 verticalAlignment: Text.AlignTop
170 fontSize: "medium"165 fontSize: "medium"
171 text: {166 text: {
172 if (contactWatcher.phoneNumber == "x-ofono-private") {167 if (participant.phoneNumber == "x-ofono-private") {
173 return i18n.tr("Private number")168 return i18n.tr("Private number")
174 } else if (contactWatcher.phoneNumber == "x-ofono-unknown") {169 } else if (participant.phoneNumber == "x-ofono-unknown") {
175 return i18n.tr("Unknown number")170 return i18n.tr("Unknown number")
176 } else if (contactWatcher.alias != "") {171 } else if (participant.alias && participant.alias !== "") {
177 return contactWatcher.alias172 return participant.alias
178 }173 }
179 return PhoneUtils.PhoneUtils.format(contactWatcher.phoneNumber)174 return PhoneUtils.PhoneUtils.format(participant.phoneNumber)
180 }175 }
181 elide: Text.ElideRight176 elide: Text.ElideRight
182 color: UbuntuColors.lightAubergine177 color: UbuntuColors.lightAubergine
@@ -220,7 +215,7 @@
220 fontSize: "small"215 fontSize: "small"
221 // FIXME: handle conference call216 // FIXME: handle conference call
222 text: phoneNumberSubTypeLabel217 text: phoneNumberSubTypeLabel
223 visible: interactive && !contactWatcher.isUnknown // non-interactive entries are calls from unknown or private numbers218 visible: interactive && !unknownContact
224 }219 }
225220
226 // time and duration on the right side of the delegate221 // time and duration on the right side of the delegate
227222
=== modified file 'src/qml/HistoryPage/HistoryPage.qml'
--- src/qml/HistoryPage/HistoryPage.qml 2014-08-27 20:07:54 +0000
+++ src/qml/HistoryPage/HistoryPage.qml 2014-09-12 21:08:50 +0000
@@ -103,7 +103,7 @@
103 visible: false103 visible: false
104 property variant model: Item {104 property variant model: Item {
105 property string senderId: "dummy"105 property string senderId: "dummy"
106 property variant participants: ["dummy"]106 property variant participants: [ {phoneNumber:"dummy"} ]
107 }107 }
108 }108 }
109109
@@ -152,6 +152,7 @@
152 sortOrder: HistorySort.DescendingOrder152 sortOrder: HistorySort.DescendingOrder
153 }153 }
154 filter: emptyFilter154 filter: emptyFilter
155 matchContacts: true
155 }156 }
156157
157 MultipleSelectionListView {158 MultipleSelectionListView {
@@ -322,7 +323,7 @@
322 text: i18n.tr("Details")323 text: i18n.tr("Details")
323 onTriggered: {324 onTriggered: {
324 pageStack.push(Qt.resolvedUrl("HistoryDetailsPage.qml"),325 pageStack.push(Qt.resolvedUrl("HistoryDetailsPage.qml"),
325 { phoneNumber: participants[0],326 { phoneNumber: participants[0].phoneNumber,
326 events: model.events,327 events: model.events,
327 eventModel: historyEventModel})328 eventModel: historyEventModel})
328 }329 }

Subscribers

People subscribed via source and target branches