Merge lp:~mhr3/unity-lens-shopping/use-proper-emblems into lp:unity-lens-shopping

Proposed by Michal Hruby
Status: Merged
Approved by: Didier Roche
Approved revision: 24
Merged at revision: 24
Proposed branch: lp:~mhr3/unity-lens-shopping/use-proper-emblems
Merge into: lp:unity-lens-shopping
Diff against target: 64 lines (+36/-4)
2 files modified
src/scope.vala (+23/-4)
tests/manual-tests/shopping-lens-tests.txt (+13/-0)
To merge this branch: bzr merge lp:~mhr3/unity-lens-shopping/use-proper-emblems
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
Review via email: mp+126461@code.launchpad.net

Commit message

Use proper emblems on the search results

Description of the change

So far we're not using proper emblems on the search results, this ensures we do.

Trivial change, no new tests.

To post a comment you must log in.
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Works fine with latest branch of Unity. +1.

review: Approve
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Ahh.. can you update manual tests?

review: Needs Fixing
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-lens-shopping/1/console reported an error when processing this lp:~mhr3/unity-lens-shopping/use-proper-emblems branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

+1

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-lens-shopping/2/console reported an error when processing this lp:~mhr3/unity-lens-shopping/use-proper-emblems branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-lens-shopping/3/console reported an error when processing this lp:~mhr3/unity-lens-shopping/use-proper-emblems branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scope.vala'
2--- src/scope.vala 2012-09-26 15:33:10 +0000
3+++ src/scope.vala 2012-09-27 08:48:21 +0000
4@@ -383,13 +383,32 @@
5
6 if (image_uri != "")
7 {
8- // TODO: what to do if we have price but no icon?
9 var file = File.new_for_uri (image_uri);
10 var icon = new AnnotatedIcon (new FileIcon (file));
11 // FIXME: dash doesn't like empty string as ribbon
12- icon.ribbon = price == null || price == "" ? " " : price;
13- // FIXME: the service doesn't expose categories yet
14- // icon.category = CategoryType.BOOK;
15+ icon.ribbon = price == null || price == "" ? " " : price;
16+
17+ unowned string category = "";
18+ if (result.has_member ("category"))
19+ category = result.get_string_member ("category");
20+ switch (category)
21+ {
22+ case "application":
23+ icon.category = CategoryType.APPLICATION;
24+ break;
25+ case "movie":
26+ icon.category = CategoryType.MOVIE;
27+ break;
28+ case "music":
29+ icon.category = CategoryType.MUSIC;
30+ break;
31+ case "book":
32+ icon.category = CategoryType.BOOK;
33+ break;
34+ default:
35+ icon.category = CategoryType.HOME; // will use generic icon
36+ break;
37+ }
38 image_uri = icon.to_string ();
39 }
40
41
42=== modified file 'tests/manual-tests/shopping-lens-tests.txt'
43--- tests/manual-tests/shopping-lens-tests.txt 2012-09-26 06:38:26 +0000
44+++ tests/manual-tests/shopping-lens-tests.txt 2012-09-27 08:48:21 +0000
45@@ -70,6 +70,19 @@
46 Expected Results:
47 Web site for selected item is opened in web browser, with an option to complete purchase.
48
49+Emblems on icons provided by the Shopping lens
50+----------------------------------------------------
51+Whenever there are results from the shopping lens, emblems are present on the icons.
52+
53+Setup:
54+Internet connectivity.
55+
56+Actions:
57+Perform a search so that some results in the "More suggestions" category are displayed. (for example search for "novel")
58+
59+Expected Results:
60+All items that are displayed have an icon categorizing the product - either a music icon, book, movie, or a generic shopping bag icon along with a price.
61+
62 'Disable' Shopping Lens Search
63 ----------------------------------------------------
64 Disabling the shopping lens should not show any result.

Subscribers

People subscribed via source and target branches

to all changes: