Other approach (using qpa): https://invent.kde.org/lnj/plasma-integration/-/tree/feature/mobile-kirigami-ui
(I prefer xdg portals, because I don't want to maintain this twice for sandboxed and non-sandboxed apps)
@davidedmundson I'm mentioning you here because I think you had the idea to base the PlaMo file dialog on xdg-desktop-portal. I have been working on this approach for some time. Now I wonder where to best put the code. I began by forking xdg-desktop-portal-kde, but it would be probably better to integrate it into the exisiting portal.
My current approach is to put the QML part into kirigami-addons in D29168: WIP: Import filepicker from xdg-desktop-portal-kirigami and fix various issues, as other people where interested in using it in their applications. xdg-desktop-portal-kde would then choose the correct file dialog to open based on either environment variables or kirigami tablet mode. A thin KFileWidget like c++ wrapper around the QML would have to be added to xdg-desktop-portal for that. What do you think?
@jgrulich, since you are working on xdg-desktop-portal-kde, do you have an opionion on where the mobile file picker ui should go?
Options are basically:
- everything into xdg-desktop-portal-kde
- KIO (would still need special handling in the portal)
- put actual gui code in Kirigami-addons and call it from the portal
- create a new portal for mobile
- I don't mind having it directly in xdg-desktop-portal-kde, but if it's something that might be re-used, it might be better to put it into some framework.
2-3) Kirigami-addons will be probably my preference. It sounds like something that can be re-used so why not write it that way. Then in xdg-desktop-portal-kde we will just check if it's running on mobile and create a dialog based on that.
- This might complicate it a bit, because you either would need to implement all the other portals which are same for both the desktop and mobile, or you would need to set different value to XDG_CURRENT_DESKTOP so xdg-desktop-portal first loads your portal implementation for some portals and then xdg-desktop-portal-kde as fallback for the rest.