[10:05] <akiva-thinkpad> !ping
[10:05] <akiva-thinkpad> cool
[10:05] <akiva-thinkpad> ports no longer blocked
[18:09] <aquarius> OK, who, other than Ken, knows about the Content Hub? I can't work out for the life of me how to use it :(
[18:33] <ahayzen> aquarius, what are you trying todo with it?
[18:51] <aquarius> ahayzen, I have a list of the filenames of files in my app's data folder, and I show them in a ListView. I would like tapping a filename to show a list of apps on the phone which I can share that file to, and then choosing an app to open that file in that app.
[18:51] <ahayzen> ok
[18:51] <aquarius> ahayzen, and I cannot work out how. A ContentPeerPicker presumably has something to do with it.
[18:52] <ahayzen> yeah it will do... i've only done an import (need to still implement export for music)..but this may be useful..
[18:52] <aquarius> Also, every example I can find shows a Page with a ContentPeerPicker in it, and the app pushes that Page onto a PageStack. But my app doesn't have a PageStack, it has Tabs, so I don't know how to even show the Picker, even if I could get it working, which I can't. :)
[18:52] <ahayzen> https://code.launchpad.net/~ken-vandine/+junk/hub-exporter
[18:53] <aquarius> Yeah, I've done import; Readability appears in the browser's Share menu. It's being a source for sharing (without being a source for other apps that want to import a file) that I can't work out.
[18:53] <aquarius> Yup, I've been looking at the hub exporter code, which as far as I can tell is the nearest thing to actual documentation of this stuff, but it's pretty impenetrable :(
[18:54] <ahayzen> so what have you got working so far?
[18:55] <aquarius> nothing. The actual ContentHub code is complaining about not having peers, but Ken's hub-importer doesn't even *mention* PeerModelLoader, so I have no idea where one of those comes from
[18:55] <aquarius> I can't even get started -- I can work out so little about this stuff that I don't even know what I don't know, if you see what I mean!
[18:56] <ahayzen> he has a ContentPeerPicker {}
[18:57] <ahayzen> IIRC the way his works is to load up activeTransfer with the items to transfer
[18:57] <ahayzen> then it then picker is shown
[18:57] <ahayzen> then it calls __exportItems(url)
[18:58] <aquarius> He does, and I have one too, but when I try to use it, I get "file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Content/ContentPeerPicker.qml:229: TypeError: Cannot read property 'peers' of null"... and that code line is  "model: customPeerModelLoader ? customPeerModelLoader.item.peers : peerModelLoader.item.peers"... that is, it's expecting to have a PeerModelLoader or a CustomPeerModelLoader, and Ken doesn't
[18:58] <aquarius> have one, so I don't get how any of it works :)
[19:01] <ahayzen> ugh i fear i'm going to have to figure this out for music soon as well :-)
[19:03]  * ahayzen wonders if that is a type "customer" https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Content.ContentPeerPicker/#customerPeerModelLoader-prop
[19:03] <ahayzen> *typo lol
[19:03] <aquarius> I have been assuming that that's meant to be "custom", yeah :)
[19:03] <ahayzen> it says *optional*
[19:03] <aquarius> but that is far from the worst fault in the documentation
[19:04] <aquarius> ya, I *think* that if you want to provide your own peermodelloader you can set that to override the system one
[19:04] <aquarius> but I don't seem to *have* the system one, and I don't know how to set it up, because the hub-importer never mentions it!
[19:04] <ahayzen> when you look at this page https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Content/ your just like which Content* thing do i want?!
[19:05] <aquarius> this stuff is totally indecipherable; the docs are either low-level API docs or high-level handwavy "the content hub is for exchanging files between apps" stuff. There are no explanations of *how to use it* :(
[19:05] <ahayzen> what does you code look like currently?
[19:06] <aquarius> http://pastebin.ubuntu.com/11868377/
[19:06] <aquarius> but that's not useful
[19:06] <aquarius> because I'm literally just altering stuff at random ;)
[19:06] <aquarius> and clicking the listitem throws "ContentPeerPicker.qml:229: TypeError: Cannot read property 'peers' of null"
[19:08] <ahayzen> "ContentType.Uknown" https://developer.ubuntu.com/api/apps/qml/sdk-15.04/Ubuntu.Content.ContentType/
[19:08] <ahayzen> who wrote these docs ? lol
[19:08] <aquarius> is there an app which can share a file to other apps, so I can look at the source? mzanetti's Tagger does it, I think, but I don't understand that either :)
[19:09] <ahayzen> yeah camera, gallery do as well IIRC
[19:09] <mzanetti> aquarius, huh? you mean content hub?
[19:09] <ahayzen> yup
[19:09] <aquarius> mzanetti, I do
[19:10] <mzanetti> aquarius, ~mzanetti/+junk/contenthubtest
[19:10] <mzanetti> this is a test app I use when I do something with contenthub
[19:10] <aquarius> ooh, that sounds useful ;)
[19:10] <mzanetti> it can share and receive anything
[19:10] <mzanetti> not 100% finished yet
[19:10] <aquarius> thank you! I shall look at that
[19:10] <mzanetti> I plan to publish to store once it's ready... but should work fine for most parts already
[19:12] <ahayzen> aquarius, also just found this which is a text only exporter http://bazaar.launchpad.net/~ken-vandine/+junk/hub-text-exporter/view/head:/Main.qml which looks quite simple compared to the others
[19:15] <aquarius> mzanetti, what's the difference between "share" and "export"?
[19:15] <ahayzen> haha
[19:16] <aquarius> that's in the content hub api, it's not a peculiarity of mzanetti's app. But nothing describes what the difference is!
[19:16] <ahayzen> i did know the difference at one point...
[19:19] <mzanetti> aquarius, export is to "save" a file, share is to post it to facebook etc
[19:19] <mzanetti> aquarius, depending on which one you select you'll notice different apps showing up in the ContentPeerPicker
[19:20] <ahayzen> mzanetti, how does that filter it? by the type of content?
[19:20] <mzanetti> two things. ContentType and handler (share vs export)
[19:21] <ahayzen> ah ok so by having destination: [music] .. we only appear under export IIRC ?
[19:21] <mzanetti> not necessarily... every app accepting content can specify both
[19:22] <mzanetti> you can also write an app to share music
[19:22] <ahayzen> yeah i need to make music a source of music at some point
[19:22] <ahayzen> so then you could go from the Clock and pick a track for your alarm
[19:23] <ahayzen> or your ringtone whatever
[19:26] <aquarius> since my app is basically like the file manager, I think I'd want a combination of both, but I don't know how to do that either..
[19:28] <mzanetti> aquarius, for sending things to other apps you need: the apparmor policy content_exchange_source
[19:29] <mzanetti> in your app have a "share" button, onClicked show a ContentPeerPicker with contentType: ContentType.All (or restrict to whatever) and handler ContentType.Share
[19:30] <mzanetti> onPeerPicked, create a new ContentItem, set the url property to your file and and set it's state to Charged
[19:31] <aquarius> ok, that makes sense; let me try that
[19:33] <mzanetti> then you can add a "save" or "open with..." button and do exactly the same, but set the picker's handler property to ContentHandler.Destination
[19:33] <mzanetti> for receiving content it's a bit different then...
[19:42] <aquarius> Simplest imaginable approach: all I want to do is show a ContentPeerPicker (I'm not even trying to do the transfer yet, so we'll screw up when a peer is picked), code at http://pastebin.ubuntu.com/11868561/ and it throws error "ContentPeerPicker.qml:229: TypeError: Cannot read property 'peers' of null" on startup... presumably because I don't set a PeerModel? Or something? Confused
[19:50] <mzanetti> aquarius, hmm... are you running it on the desktop?
[19:51] <aquarius> ah. I am. That may be it. I'll try it on the phone, then...
[19:54] <aquarius> same error...
[19:55] <aquarius> ContentPeerPicker10.qml:186: TypeError: Cannot read property 'peers' of null
[20:12] <aquarius> let me try your contenthubtest and work out what's different :)