QProcess and Sailjail

As I wrote earlier, my code is based on the “official” transfer-engine example, so it doesn’t differ from other projects based on it, including @attah’s plugin. I only use different MIME types to only allow URLs, and a few minor additions like using serviceIcon to show my applications icon to distinguish those transfers somehow due to lack of any other info shown.

It looks that with content like URL or text string the transfer-engine simply doesn’t set the values needed to show any further details on the Transfers screen, except for time stamp and transfer type icon (which it sets as upload, another thing that I can’t figure out how to change). If I use the same code to share e.g. share an image, it shows further details as it should. But not with a text or URL. Trying to set those values manually doesn’t seem to have any effect, either. I suppose that even if set so then the transfer engine clears/resets them anyway.

P.S. I’ve just tested “Open link sharing plugin” from openrepos and it has identical problems - all transfers listed as Pending and then Failed (which I fixed in my code by setStatus(MediaTransferInterface::TransferFinished)), and no further details shown.

So it looks like a general transfer-engine defect with this kind of content. Will keep trying to find some workaround, but I’m slowly losing hope.

Ok. This sounds like a bug report.

Although I have one hacky idea. What about saving the url to a text file, temp.url , and sharing that? I mean, it’s a hack. At least in the plugin context you should be able to do cleanup on TransferFinished?

I have one like it. In order to keep calendar sharing from Fahrplan (train schedules) simple, I go even further and just dump to a temp file (.ics) and xdg-open. That means the app has to do file housekeeping, so kinda of ugly, but it works…

I’ll check, but I’m afraid that in such case the Transfers list would be showing the file name (e.g. temp.url) not its contents. If I read it correctly, /usr/lib64/qt5/qml/Sailfish/TransferEngine/TransfersPage.qml seems to be ‘hardcoded’ to show resourceName (which it takes from file url / path) and there’s no way to make it display something else without patching that file.

The worst thing is that there is no option to just “opt out” from showing a transfer on the list at all. Just like we can enable notifications or not (and furthermore, decide if they’re persistent i.e. shown on the Events screen or not), there should be a way to choose whether to show a sharing/transfer (I don’t really understand the difference) operation on the Transfers screen or not. In such case I’d happily choose not to list it as I don’t really need it there and in its current form (i.e. without showing any details allowing to identify what sharing operation it refers to) it only makes a mess on the Transfers list :unamused:

Anyway, considering the above (probably unsolvable) problems, I’m starting to think about rewriting it, maybe in a Whisperfish plugin way, because I would like to be able to share multiple times to the same instance of my application rather than have new instance opened each time.

Maybe I could make some progress if I knew how to debug this damn thing. This is the first time I’ve actually made something with a plugin like this (on BB10 there was a very nice Invocation Framework for such things, easy and pleasant to use), so I actually have no idea how to start it in a debugger so that I could thoroughly test all of its variables, step by step. Obviously, when I launch the debugger normally, it starts the main executable (i.e. my actual application), which is already past the stage of the plugin’s activity. Should I build the plugin separately for debugging purposes, without the actual app? And then what? It’s a library, so how to start it in a debugger with some valid input (e.g. the URL it is normally intented to transfer to my app)? Sorry for being such a complete newbie in this area.