Merge lp:~stolowski/unity-lens-shopping/restore-category-icons into lp:unity-lens-shopping

Proposed by Paweł Stołowski
Status: Merged
Approved by: Michal Hruby
Approved revision: 31
Merged at revision: 31
Proposed branch: lp:~stolowski/unity-lens-shopping/restore-category-icons
Merge into: lp:unity-lens-shopping
Diff against target: 72 lines (+36/-5)
2 files modified
src/scope.vala (+23/-4)
tests/manual-tests/shopping-lens-tests.txt (+13/-1)
To merge this branch: bzr merge lp:~stolowski/unity-lens-shopping/restore-category-icons
Reviewer Review Type Date Requested Status
Michal Hruby (community) Approve
Review via email: mp+129127@code.launchpad.net

Commit message

Restored support for category icons (merged rev. 25..24).

Description of the change

Restored support for category icons (merged rev. 25..24).

To post a comment you must log in.
Revision history for this message
Michal Hruby (mhr3) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/scope.vala'
--- src/scope.vala 2012-10-03 11:07:45 +0000
+++ src/scope.vala 2012-10-11 09:21:22 +0000
@@ -390,13 +390,32 @@
390390
391 if (image_uri != "")391 if (image_uri != "")
392 {392 {
393 // TODO: what to do if we have price but no icon?
394 var file = File.new_for_uri (image_uri);393 var file = File.new_for_uri (image_uri);
395 var icon = new AnnotatedIcon (new FileIcon (file));394 var icon = new AnnotatedIcon (new FileIcon (file));
396 // FIXME: dash doesn't like empty string as ribbon395 // FIXME: dash doesn't like empty string as ribbon
397 icon.ribbon = price == null || price == "" ? " " : price; 396 icon.ribbon = price == null || price == "" ? " " : price;
398 // FIXME: the service doesn't expose categories yet397
399 // icon.category = CategoryType.BOOK;398 unowned string category = "";
399 if (result.has_member ("category"))
400 category = result.get_string_member ("category");
401 switch (category)
402 {
403 case "application":
404 icon.category = CategoryType.APPLICATION;
405 break;
406 case "movie":
407 icon.category = CategoryType.MOVIE;
408 break;
409 case "music":
410 icon.category = CategoryType.MUSIC;
411 break;
412 case "book":
413 icon.category = CategoryType.BOOK;
414 break;
415 default:
416 icon.category = CategoryType.HOME; // will use generic icon
417 break;
418 }
400 image_uri = icon.to_string ();419 image_uri = icon.to_string ();
401 }420 }
402421
403422
=== modified file 'tests/manual-tests/shopping-lens-tests.txt'
--- tests/manual-tests/shopping-lens-tests.txt 2012-10-03 12:13:26 +0000
+++ tests/manual-tests/shopping-lens-tests.txt 2012-10-11 09:21:22 +0000
@@ -24,7 +24,7 @@
2424
25Expected Result:25Expected Result:
26Verify that Applications / Files & Folders / Music / Video / More suggestions home lens categories26Verify that Applications / Files & Folders / Music / Video / More suggestions home lens categories
27(if results are available for them) are ordered by number of results, with personal content taking precedence 27(if results are available for them) are ordered by number of results, with personal content taking precedence
28(applications, local music files, local videos etc. are considered personal content) over shopping results,28(applications, local music files, local videos etc. are considered personal content) over shopping results,
29with an exception that 'More suggestions' is displayed no further than on 3rd position.29with an exception that 'More suggestions' is displayed no further than on 3rd position.
30Verify that shopping results have orange price ribbons on top of item pictures.30Verify that shopping results have orange price ribbons on top of item pictures.
@@ -84,6 +84,18 @@
84Expected Results:84Expected Results:
85An empty preview should be displayed. Note that performing searches without internet connectivity will not return any results in the "More suggestions" category.85An empty preview should be displayed. Note that performing searches without internet connectivity will not return any results in the "More suggestions" category.
8686
87Emblems on icons provided by the Shopping lens
88----------------------------------------------------
89Whenever there are results from the shopping lens, emblems are present on the icons.
90
91Setup:
92Internet connectivity.
93
94Perform a search so that some results in the "More suggestions" category are displayed. (for example search for "novel")
95
96Expected Results:
97All 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.
98
87'Disable' Shopping Lens Search99'Disable' Shopping Lens Search
88----------------------------------------------------100----------------------------------------------------
89Disabling the shopping lens should not show any result.101Disabling the shopping lens should not show any result.

Subscribers

People subscribed via source and target branches