Merge lp:~kissiel/checkbox/fix-1493467-uncategorized-skipped into lp:checkbox

Proposed by Maciej Kisielewski
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 4059
Merged at revision: 4062
Proposed branch: lp:~kissiel/checkbox/fix-1493467-uncategorized-skipped
Merge into: lp:checkbox
Diff against target: 31 lines (+13/-7)
1 file modified
checkbox-touch/checkbox-touch.qml (+13/-7)
To merge this branch: bzr merge lp:~kissiel/checkbox/fix-1493467-uncategorized-skipped
Reviewer Review Type Date Requested Status
Sylvain Pineau Approve
Review via email: mp+275245@code.launchpad.net

Description of the change

This MR makes the categorySelectionScreen detect having only one item listed
and that being id: "2013.com.canonical.plainbox::uncategorised". As a result it
will call trigger selectionDone signal, as would normal (manual) selection.

8b76c60 checkbox-touch: skip category selection if only uncategorized tests present

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-touch/checkbox-touch.qml'
2--- checkbox-touch/checkbox-touch.qml 2015-10-14 21:48:15 +0000
3+++ checkbox-touch/checkbox-touch.qml 2015-10-21 21:24:37 +0000
4@@ -318,14 +318,20 @@
5
6 function setup(continuation) {
7 app.getCategories(function(response) {
8- var category_info_list = response.category_info_list;
9- model.clear();
10- for (var i=0; i<category_info_list.length; i++) {
11- var category_info = category_info_list[i];
12- model.append(category_info);
13+ var uncategorised_id = "2013.com.canonical.plainbox::uncategorised"
14+ if (response.category_info_list.length === 1 &&
15+ response.category_info_list[0].mod_id == uncategorised_id) {
16+ selectionDone(uncategorised_id);
17+ } else {
18+ var category_info_list = response.category_info_list;
19+ model.clear();
20+ for (var i=0; i<category_info_list.length; i++) {
21+ var category_info = category_info_list[i];
22+ model.append(category_info);
23+ }
24+ modelUpdated();
25+ pageStack.push(categorySelectionPage);
26 }
27- modelUpdated();
28- pageStack.push(categorySelectionPage);
29 // if called from welcome page, no continuation is given
30 if (continuation) continuation();
31 });

Subscribers

People subscribed via source and target branches