Merge lp:~renatofilho/address-book-app/fix-1470196 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Ken VanDine
Approved revision: 453
Merged at revision: 455
Proposed branch: lp:~renatofilho/address-book-app/fix-1470196
Merge into: lp:address-book-app
Diff against target: 60 lines (+32/-2)
2 files modified
src/imports/MainWindow.qml (+2/-2)
tests/qml/tst_ContactList.qml (+30/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1470196
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+263563@code.launchpad.net

Commit message

Make sure that the contact list enter in single selection mode when requested by content hub.

Description of the change

Make sure that the contact list enter in single selection mode when requested by content hub.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 LABELS CHANGED

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

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Code looks good and I confirmed that single select is chosen when it should

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/MainWindow.qml'
2--- src/imports/MainWindow.qml 2015-04-28 16:29:44 +0000
3+++ src/imports/MainWindow.qml 2015-07-01 17:53:42 +0000
4@@ -61,14 +61,14 @@
5 function pick(single)
6 {
7 console.debug("Pick mode:" + single)
8- pickWithTransfer(single, null)
9+ pickWithTransfer(single === "true", null)
10 }
11
12 function pickWithTransfer(single, activeTransfer)
13 {
14 mainStack.resetStack()
15 if (mainStack.contactListPage) {
16- mainStack.contactListPage.startPickMode(single === "true", activeTransfer)
17+ mainStack.contactListPage.startPickMode(single, activeTransfer)
18 } else {
19 console.error("Pick mode requested but ContactListPage not loaded")
20 }
21
22=== modified file 'tests/qml/tst_ContactList.qml'
23--- tests/qml/tst_ContactList.qml 2015-04-29 14:22:40 +0000
24+++ tests/qml/tst_ContactList.qml 2015-07-01 17:53:42 +0000
25@@ -99,5 +99,35 @@
26 {
27 tryCompare(root.contactListPageObj, "contactManager", "memory")
28 }
29+
30+ function test_pickMode()
31+ {
32+ var listView = findChild(root.contactListPageObj, "contactListView")
33+ // check initial state
34+ compare(root.contactListPageObj.pickMode, false)
35+ compare(root.contactListPageObj.pickMultipleContacts, false)
36+
37+ // by default the list accepts multi-selection but the selection mode is disabled
38+ compare(listView.multipleSelection, true)
39+ compare(listView.isInSelectionMode, false)
40+
41+ // start multi-selection pick mode
42+ root.contactListPageObj.startPickMode(false /*isSingle*/, null)
43+
44+ // check multi-selection mode
45+ compare(root.contactListPageObj.pickMode, true)
46+ compare(root.contactListPageObj.pickMultipleContacts, true)
47+ compare(listView.multipleSelection, true)
48+ compare(listView.isInSelectionMode, true)
49+
50+ // start single-selection pick mode
51+ root.contactListPageObj.startPickMode(true /*isSingle*/, null)
52+
53+ // check single-selection mode
54+ compare(root.contactListPageObj.pickMode, true)
55+ compare(root.contactListPageObj.pickMultipleContacts, false)
56+ compare(listView.multipleSelection, false)
57+ compare(listView.isInSelectionMode, true)
58+ }
59 }
60 }

Subscribers

People subscribed via source and target branches