Merge lp:~zhangew401/unity-scope-youtube/support-content-sharing into lp:unity-scope-youtube

Proposed by Zhang Enwei
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 152
Merged at revision: 152
Proposed branch: lp:~zhangew401/unity-scope-youtube/support-content-sharing
Merge into: lp:unity-scope-youtube
Diff against target: 49 lines (+13/-1)
2 files modified
CMakeLists.txt (+1/-1)
src/youtube/scope/preview.cpp (+12/-0)
To merge this branch: bzr merge lp:~zhangew401/unity-scope-youtube/support-content-sharing
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
Pete Woods Pending
Unity API Team Pending
Review via email: mp+288244@code.launchpad.net

Description of the change

The change is simple, only adding attributes for image and video widgets in Preview.

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

Looks good! +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-01-29 08:53:46 +0000
3+++ CMakeLists.txt 2016-03-07 08:40:32 +0000
4@@ -38,7 +38,7 @@
5 ${SCOPE_INCLUDE_DIRS}
6 )
7
8-set(SCOPE_VERSION "1.5.0-${BZR_REVNO}")
9+set(SCOPE_VERSION "1.5.1-${BZR_REVNO}")
10 set(CMAKE_INSTALL_PREFIX /)
11 set(SCOPE_NAME "com.ubuntu.scopes.youtube")
12 set(SCOPE_INSTALL_NAME "${SCOPE_NAME}_youtube")
13
14=== modified file 'src/youtube/scope/preview.cpp'
15--- src/youtube/scope/preview.cpp 2016-02-02 05:08:36 +0000
16+++ src/youtube/scope/preview.cpp 2016-03-07 08:40:32 +0000
17@@ -85,6 +85,10 @@
18 sc::PreviewWidget video("video", "video");
19 video.add_attribute_mapping("source", "link");
20 video.add_attribute_mapping("screenshot", "art");
21+ sc::VariantMap share_data;
22+ share_data["uri"] = result()["link"];
23+ share_data["content-type"] = sc::Variant("videos");
24+ video.add_attribute_value("share-data", sc::Variant(share_data));
25 widgets.emplace_back(video);
26
27 sc::PreviewWidget w_expandable("expandable", "expandable");
28@@ -227,6 +231,10 @@
29
30 sc::PreviewWidget image("image", "image");
31 image.add_attribute_mapping("source", "art");
32+ sc::VariantMap share_data;
33+ share_data["uri"] = result()["art"];
34+ share_data["content-type"] = sc::Variant("pictures");
35+ image.add_attribute_value("share-data", sc::Variant(share_data));
36
37 sc::PreviewWidget description("summary", "text");
38 description.add_attribute_mapping("text", "description");
39@@ -260,6 +268,10 @@
40 boost::replace_all(artwork_url, "s88-c-k-no", "s240-c-k-no");
41 sc::PreviewWidget art("art", "image");
42 art.add_attribute_value("source", sc::Variant(artwork_url));
43+ sc::VariantMap share_data;
44+ share_data["uri"] = result()["art"];
45+ share_data["content-type"] = sc::Variant("pictures");
46+ art.add_attribute_value("share-data", sc::Variant(share_data));
47
48 sc::PreviewWidget statistics("statistics", "header");
49 statistics.add_attribute_value("title", sc::Variant(

Subscribers

People subscribed via source and target branches

to all changes: