Merge lp:~renatofilho/address-book-service/fix-vcard-import into lp:address-book-service

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Michael Sheldon
Approved revision: 164
Merged at revision: 179
Proposed branch: lp:~renatofilho/address-book-service/fix-vcard-import
Merge into: lp:address-book-service
Diff against target: 40 lines (+19/-0)
2 files modified
lib/detail-context-parser.cpp (+4/-0)
tests/unittest/qcontacts-test.cpp (+15/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-service/fix-vcard-import
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+272310@code.launchpad.net

Commit message

Fix importing vcards that contains address with multiple types.

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 :

Are there any related MPs required for this MP to build/function as expected?
NO

Is your branch in sync with latest trunk?
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 on device or emulator?
YES

If you changed the UI, was the change specified/approved by design?
NO UI CHANGED

If you changed UI labels, did you update the pot file?
NO LABEL CHANGED

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
NO PACKAGE CHANGED

164. By Renato Araujo Oliveira Filho

Trunk merged.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Added a couple of diff comments

review: Needs Fixing
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) :
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Thanks for clarifying, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/detail-context-parser.cpp'
2--- lib/detail-context-parser.cpp 2014-07-08 19:24:25 +0000
3+++ lib/detail-context-parser.cpp 2015-10-27 15:15:49 +0000
4@@ -75,6 +75,10 @@
5 break;
6 case QContactDetail::TypeAddress:
7 context << parseAddressContext(detail);
8+ // Setting more than one context causes folks to freeze
9+ if (!context.isEmpty()) {
10+ return context.mid(0,1);
11+ }
12 break;
13 case QContactDetail::TypeOnlineAccount:
14 context << parseOnlineAccountContext(detail);
15
16=== modified file 'tests/unittest/qcontacts-test.cpp'
17--- tests/unittest/qcontacts-test.cpp 2015-09-24 17:47:49 +0000
18+++ tests/unittest/qcontacts-test.cpp 2015-10-27 15:15:49 +0000
19@@ -574,6 +574,21 @@
20 QCOMPARE(updatedName.lastName(), name.lastName());
21 }
22
23+ void testAddressWithMultipleSubTypes()
24+ {
25+ // create a contact
26+ QContact contact = testContact();
27+ QContactAddress addr;
28+ addr.setLocality("8777 West Six Mile Road");
29+ addr.setContexts(QList<int>() << QContactDetail::ContextWork);
30+ addr.setSubTypes(QList<int>() << QContactAddress::SubTypeParcel << QContactAddress::SubTypeDomestic);
31+ contact.saveDetail(&addr);
32+
33+ QSignalSpy spyContactAdded(m_manager, SIGNAL(contactsAdded(QList<QContactId>)));
34+ bool result = m_manager->saveContact(&contact);
35+ QCOMPARE(result, true);
36+ QTRY_COMPARE(spyContactAdded.count(), 1);
37+ }
38 };
39
40 QTEST_MAIN(QContactsTest)

Subscribers

People subscribed via source and target branches