Merge lp:~tiagosh/dialer-app/fallback-to-original-number into lp:dialer-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 479
Merged at revision: 481
Proposed branch: lp:~tiagosh/dialer-app/fallback-to-original-number
Merge into: lp:dialer-app
Diff against target: 65 lines (+16/-5)
2 files modified
src/qml/HistoryPage/HistoryDelegate.qml (+5/-1)
src/qml/HistoryPage/HistoryDetailsPage.qml (+11/-4)
To merge this branch: bzr merge lp:~tiagosh/dialer-app/fallback-to-original-number
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+277252@code.launchpad.net

Commit message

Fallback to original phone number when format() returns a blank string

Description of the change

Fallback to original phone number when format() returns a blank string

To post a comment you must log in.
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/qml/HistoryPage/HistoryDelegate.qml'
--- src/qml/HistoryPage/HistoryDelegate.qml 2015-10-23 20:43:44 +0000
+++ src/qml/HistoryPage/HistoryDelegate.qml 2015-11-11 14:25:58 +0000
@@ -170,7 +170,11 @@
170 } else if (participant.alias && participant.alias !== "") {170 } else if (participant.alias && participant.alias !== "") {
171 return participant.alias171 return participant.alias
172 }172 }
173 return PhoneUtils.PhoneUtils.format(phoneNumber)173 var formattedPhoneNumber = PhoneUtils.PhoneUtils.format(phoneNumber)
174 if (formattedPhoneNumber !== "") {
175 return formattedPhoneNumber
176 }
177 return phoneNumber
174 }178 }
175 elide: Text.ElideRight179 elide: Text.ElideRight
176 color: UbuntuColors.lightAubergine180 color: UbuntuColors.lightAubergine
177181
=== modified file 'src/qml/HistoryPage/HistoryDetailsPage.qml'
--- src/qml/HistoryPage/HistoryDetailsPage.qml 2015-09-07 15:40:45 +0000
+++ src/qml/HistoryPage/HistoryDetailsPage.qml 2015-11-11 14:25:58 +0000
@@ -37,7 +37,8 @@
3737
38 objectName: "historyDetailsPage"38 objectName: "historyDetailsPage"
39 anchors.fill: parent39 anchors.fill: parent
40 title: {40
41 function getFormattedPhoneLabel(phoneNumber) {
41 if (phoneNumber == "x-ofono-private") {42 if (phoneNumber == "x-ofono-private") {
42 return i18n.tr("Private number")43 return i18n.tr("Private number")
43 } else if (phoneNumber == "x-ofono-unknown") {44 } else if (phoneNumber == "x-ofono-unknown") {
@@ -45,9 +46,15 @@
45 } else if (contactWatcher.alias != "") {46 } else if (contactWatcher.alias != "") {
46 return contactWatcher.alias47 return contactWatcher.alias
47 }48 }
48 return PhoneUtils.PhoneUtils.format(phoneNumber)49 var formattedPhoneNumber = PhoneUtils.PhoneUtils.format(phoneNumber)
50 if (formattedPhoneNumber !== "") {
51 return formattedPhoneNumber
52 }
53 return phoneNumber
49 }54 }
5055
56 title: getFormattedPhoneLabel(phoneNumber)
57
51 head.actions: [58 head.actions: [
52 Action {59 Action {
53 iconName: unknownContact ? "contact-new" : "stock_contact"60 iconName: unknownContact ? "contact-new" : "stock_contact"
@@ -138,7 +145,7 @@
138 }145 }
139 verticalAlignment: Text.AlignTop146 verticalAlignment: Text.AlignTop
140 fontSize: "medium"147 fontSize: "medium"
141 text: PhoneUtils.PhoneUtils.format(phoneNumber)148 text: getFormattedPhoneLabel(phoneNumber)
142 elide: Text.ElideRight149 elide: Text.ElideRight
143 color: UbuntuColors.lightAubergine150 color: UbuntuColors.lightAubergine
144 height: units.gu(2)151 height: units.gu(2)
@@ -263,7 +270,7 @@
263 Label {270 Label {
264 id: remoteParticipantId271 id: remoteParticipantId
265 // FIXME: we need to check if the id is actually a phone number272 // FIXME: we need to check if the id is actually a phone number
266 text: PhoneUtils.PhoneUtils.format(modelData.remoteParticipant)273 text: getFormattedPhoneLabel(modelData.remoteParticipant)
267 anchors {274 anchors {
268 left: timeLabel.right275 left: timeLabel.right
269 leftMargin: units.gu(1)276 leftMargin: units.gu(1)

Subscribers

People subscribed via source and target branches