QML question: how to provide "Open with..." dialog

Hi friends,
I am working on a small update of Timeline gallery and would like to make use of that “new” drop-down “open-with…” menu from within the app, the one that shows when clicking a link for instance.
This would give users of Timeline more options to pick and open images with - e.g. the native image app, browser or another editor, those who are registered for image mime type. Anyone knows how to call that from QML or CMD?
I tried xdg-open [filePath] on CMD and Qt.openUrlExternally(“file:///” + filePath) in QML. Both obviously open the image in my default app but do not provide other options.
Anyone would like to guide me in the right direction?
Thank you.

2 Likes

Hi. To register application for some mime type, it need to add MimeType property to its desktop file. As SailfishOS allows just one instance of application at the time, it should also register D-Bus service and set proper D-Bus options in desktop file… Then expose corresponding methods… I added support for geo: url to OSMScout recently in this commit: https://github.com/Karry/osmscout-sailfish/commit/c49d12641f9d9f654132f436eec1c218e693da9c

Unfortunately, this registration is not allowed in Jolla’s Harbour.