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.

It’s been nearly A YEAR now since I’ve been struggling to make the share/transfer plugins show on the Transfers lists anything more than just the transfer time/date and serviceIcon when sharing an URL (or actually any text string).

https://forum.sailfishos.org/uploads/db4219/original/2X/0/0c951b62925cc0dc4f7b9bbdf659789738f11d0b.jpeg

The Transfers list itself (i.e. /usr/lib64/qt5/qml/Sailfish/TransferEngine/TransfersPage.qml) is ‘hardcoded’ to show the following data: serviceIcon, status, url, thumbnailIcon, applicationIcon, resourceName (and some more, e.g. progress).

What I need to achieve is that the shared URL (text string) is also displayed (probably as resourceName) like it is the case with e.g. web browser download, where the file name / path is displayed. I would also like to change the TransferType from Upload to Download. Being able to change the thumbnail on the left would also be nice (web browser shows mime type icon there, e.g. for one of my recent downloads it shows quite incorrectly a music icon for an .rpm package), but not necessary.

Sadly, I can’t find any way to set what the Transfers list reads and displays as resourceName or the remaining types/properties. I’ve studied the code of the web browser (download manager) and other available share/transfer plugins, but it took me nowhere.

Is there really no one who knows and could help move forward by an inch?

Did you ever try something like saving the url to a text file named ‘url’ ? I would have tried a hack like:

https://sub.tld/path/dest?foo=.url

or some similar evil thing. I’ll see if I can find time this week since I’d like to revive sharing in one or the other context where I’ve simply punted it. Everyone knows I don’t really want to share :slight_smile:

Yes, I attempted to do it that way but I couldn’t make it work so I gave up…

Now I am experimenting with passing the data to the sailfishTransfer.resources object, but I can’t figure out the correct structure of it. Whatever I put there causes that the transfer plugin stops working…

It’s hard to believe how can it be so poorly documented…