Skip to content

Commit

Permalink
Add ContentStore support
Browse files Browse the repository at this point in the history
  • Loading branch information
rschroll committed Oct 23, 2015
1 parent c2df25c commit d8796be
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions main.qml
Expand Up @@ -2,7 +2,7 @@ import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1 as ListItem
import Ubuntu.Components.Popups 0.1
import Ubuntu.Content 0.1
import Ubuntu.Content 1.0

MainView {
id: mainView
Expand Down Expand Up @@ -36,7 +36,7 @@ MainView {
Button {
text: i18n.tr("... From default provider")
onClicked: {
root.activeTransfer = peer.request();
root.activeTransfer = peer_.request(store);
}
}
Button {
Expand Down Expand Up @@ -72,7 +72,7 @@ MainView {
handler must be set to Source to indicate that the app is importing. This seems
backwards to me. */
ContentPeer {
id: peer
id: peer_
contentType: ContentType.Pictures
handler: ContentHandler.Source
selectionType: ContentTransfer.Multiple
Expand All @@ -84,6 +84,15 @@ MainView {
activeTransfer: root.activeTransfer
}

ContentStore {
id: store
scope: ContentScope.App
/* System -- file:///content/Pictures/image20150201_171832388.jpg
User -- file:///home/phablet/Pictures/image20150201_171832388.jpg
App -- Right place!
*/
}

/* Watch root.activeTransfer to find out when content is ready for our use. */
Connections {
target: root.activeTransfer
Expand All @@ -108,7 +117,7 @@ MainView {

onPeerSelected: {
peer.selectionType = ContentTransfer.Multiple;
root.activeTransfer = peer.request();
root.activeTransfer = peer.request(store);
pageStack.pop();
}
}
Expand Down

0 comments on commit d8796be

Please sign in to comment.