Merge lp:~mzanetti/ubuntu-filemanager-app/share-files into lp:ubuntu-filemanager-app

Proposed by Michael Zanetti on 2016-07-12
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„ on 2016-07-25
Approved revision: 556
Merged at revision: 558
Proposed branch: lp:~mzanetti/ubuntu-filemanager-app/share-files
Merge into: lp:ubuntu-filemanager-app
Diff against target: 92 lines (+17/-7)
3 files modified
src/app/qml/content-hub/FileOpener.qml (+2/-1)
src/app/qml/filemanager.qml (+3/-2)
src/app/qml/ui/FolderListPage.qml (+12/-4)
To merge this branch: bzr merge lp:~mzanetti/ubuntu-filemanager-app/share-files
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve on 2016-07-25
Carlos Jose Mazieri 2016-07-12 Approve on 2016-07-16
Review via email: mp+299821@code.launchpad.net

Commit message

Add support for sharing files via contenthub on longpress

To post a comment you must log in.

Nice, Thanks.

review: Approve

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/filemanager-app-autolanding/46/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/5772/console

review: Needs Fixing (continuous-integration)
556. By Michael Zanetti on 2016-07-25

merge trunk

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/content-hub/FileOpener.qml'
2--- src/app/qml/content-hub/FileOpener.qml 2016-03-16 16:15:41 +0000
3+++ src/app/qml/content-hub/FileOpener.qml 2016-07-25 12:19:34 +0000
4@@ -29,6 +29,7 @@
5 property var activeTransfer
6
7 property string fileUrl
8+ property bool share: false
9
10 Component.onCompleted: {
11 var contentType = Resolver.resolveContentType(fileUrl)
12@@ -53,7 +54,7 @@
13 showTitle: false
14
15 // Type of handler: Source, Destination, or Share
16- handler: ContentHandler.Destination
17+ handler: root.share ? ContentHandler.Share : ContentHandler.Destination
18 contentType: ContentType.Pictures
19
20 onPeerSelected: {
21
22=== modified file 'src/app/qml/filemanager.qml'
23--- src/app/qml/filemanager.qml 2016-07-18 22:56:04 +0000
24+++ src/app/qml/filemanager.qml 2016-07-25 12:19:34 +0000
25@@ -128,8 +128,8 @@
26 }
27 }
28
29- function openLocalFile(filePath) {
30- pageStack.push(Qt.resolvedUrl("content-hub/FileOpener.qml"), { fileUrl: "file://" + filePath} )
31+ function openLocalFile(filePath, share) {
32+ pageStack.push(Qt.resolvedUrl("content-hub/FileOpener.qml"), { fileUrl: "file://" + filePath, share: share} )
33 }
34
35 function startImport(activeTransfer) {
36@@ -167,6 +167,7 @@
37 }
38 }
39
40+
41 Connections {
42 target: ContentHub
43 onExportRequested: {
44
45=== modified file 'src/app/qml/ui/FolderListPage.qml'
46--- src/app/qml/ui/FolderListPage.qml 2016-07-18 21:42:19 +0000
47+++ src/app/qml/ui/FolderListPage.qml 2016-07-25 12:19:34 +0000
48@@ -621,6 +621,14 @@
49 }
50
51 Action {
52+ id: shareAction
53+ text: i18n.tr("Share")
54+ onTriggered: {
55+ openFile(actionSelectionPopover.model, true)
56+ }
57+ }
58+
59+ Action {
60 id: extractAction
61 visible: actionSelectionPopover.isArchive
62 text: i18n.tr("Extract archive")
63@@ -934,12 +942,12 @@
64 }
65 }
66
67- function openFromDisk(fullpathname, name) {
68+ function openFromDisk(fullpathname, name, share) {
69 console.log("openFromDisk():"+ fullpathname)
70 // Check if file is an archive. If yes, ask the user whether he wants to extract it
71 var archiveType = getArchiveType(name)
72 if (archiveType === "") {
73- openLocalFile(fullpathname)
74+ openLocalFile(fullpathname, share)
75 } else {
76 PopupUtils.open(openArchiveDialog, folderListView,
77 { "filePath" : fullpathname,
78@@ -952,13 +960,13 @@
79
80 //High Level openFile() function
81 //remote files are saved as temporary files and then opened
82- function openFile(model) {
83+ function openFile(model, share) {
84 if (model.isRemote) {
85 //download and open later when the signal downloadTemporaryComplete() arrives
86 pageModel.downloadAsTemporaryFile(model.index)
87 }
88 else {
89- openFromDisk(model.filePath, model.fileName)
90+ openFromDisk(model.filePath, model.fileName, share)
91 }
92 }
93

Subscribers

People subscribed via source and target branches