Merge lp:~paulliu/unity8/fix-genericpreview-2 into lp:~unity-team/unity8/fix-genericpreview

Proposed by Ying-Chun Liu
Status: Merged
Merged at revision: 373
Proposed branch: lp:~paulliu/unity8/fix-genericpreview-2
Merge into: lp:~unity-team/unity8/fix-genericpreview
Diff against target: 29 lines (+10/-2)
1 file modified
Dash/Movie/MoviePreview.qml (+10/-2)
To merge this branch: bzr merge lp:~paulliu/unity8/fix-genericpreview-2
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+188594@code.launchpad.net

Description of the change

Small fix for video preview.

To post a comment you must log in.
373. By Ying-Chun Liu on 2013-10-01

Add logic to open the video.
Make sure it doesn't divide by zero.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Dash/Movie/MoviePreview.qml'
2--- Dash/Movie/MoviePreview.qml 2013-09-30 21:03:51 +0000
3+++ Dash/Movie/MoviePreview.qml 2013-10-01 13:32:08 +0000
4@@ -39,7 +39,7 @@
5 id: urlLoader
6 anchors.left: parent.left
7 anchors.right: parent.right
8- height: width * previewImage.sourceSize.height / previewImage.sourceSize.width
9+ height: previewImage.sourceSize.width != 0 ? width * previewImage.sourceSize.height / previewImage.sourceSize.width : 0
10 radius: "medium"
11 visible: height > 0
12 image: Image {
13@@ -62,7 +62,15 @@
14 MouseArea {
15 id: previewImageMouseArea
16 anchors.fill: parent
17- onClicked: shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', previewData.imageSourceUri);
18+ onClicked: {
19+ if (previewData.result.uri.indexOf("http") == 0) {
20+ Qt.openUrlExternally(previewData.result.uri);
21+ } else if (previewData.result.uri.indexOf("file") == 0) {
22+ shell.activateApplication('/usr/share/applications/mediaplayer-app.desktop', previewData.result.uri);
23+ } else {
24+ Qt.openUrlExternally(previewData.result.uri);
25+ }
26+ }
27 }
28 }
29 }

Subscribers

People subscribed via source and target branches

to all changes: