Merge lp:~tiagosh/address-book-service/fix-1208514 into lp:address-book-service

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 70
Merged at revision: 70
Proposed branch: lp:~tiagosh/address-book-service/fix-1208514
Merge into: lp:address-book-service
Diff against target: 17 lines (+7/-0)
1 file modified
qcontacts/contacts-service.cpp (+7/-0)
To merge this branch: bzr merge lp:~tiagosh/address-book-service/fix-1208514
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+185378@code.launchpad.net

Commit message

group contacts starting with non A-Z characters into a separate section.

Description of the change

Group contacts starting with non A-Z characters into a separate section.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qcontacts/contacts-service.cpp'
2--- qcontacts/contacts-service.cpp 2013-09-10 18:44:50 +0000
3+++ qcontacts/contacts-service.cpp 2013-09-12 21:51:24 +0000
4@@ -297,6 +297,13 @@
5 QContactId newId = QContactId(engineId);
6
7 contact->setId(newId);
8+ // set tag to be used when creating sections
9+ QContactName detailName = contact->detail<QContactName>();
10+ if (!detailName.firstName().isEmpty() && QString(detailName.firstName().at(0)).contains(QRegExp("([a-z]|[A-Z])"))) {
11+ contact->addTag(detailName.firstName().at(0).toUpper());
12+ } else {
13+ contact->addTag("#");
14+ }
15 contactsIds << newId;
16 }
17 }

Subscribers

People subscribed via source and target branches