SUMMARY xdg-document-portal saves the file asssociation preference per-app for apps using xdg-desktop-portal to open files. Currently the only way to manipulate xdg-document-portal settings are flatpak permission-related CLI commands. gtk 4.18 looks like going to always use xdg-desktop-portal, even when not in flatpak, so there's going to be an entire class of apps it's impossible to edit file associations for with the KCM. STEPS TO REPRODUCE 1. Open the KCM 2. See for portal's per-app file associations OBSERVED RESULT There's none EXPECTED RESULT A editable list of apps with their file associations SOFTWARE/OS VERSIONS Operating System: NixOS 25.05 KDE Plasma Version: 6.2.5 KDE Frameworks Version: 6.10.0 Qt Version: 6.8.1 Kernel Version: 6.12.10-cachyos (64-bit) Graphics Platform: Wayland
Thanks for the heads-up about this, Ilya.
Looks like I made a mistake about the version, it's actually used since 4.10 by any application using the GtkUriLauncher/GtkFileLauncher APIs (opposed to the deprecated gtk_show_uri). So it's live for around 2 years already. 4.18 won't make a difference regarding URL opening actually.
I think having per app default apps might be a bit too much to show in the UI. I had a look at this and I think it might no even be needed. - if a mime type has a default app the portal will use that - the app forces to show the app choosing dialog => nothing to do the dialog will always be shown. - the case that some mime type doesnt have a default app - in the case the user selects "remember" => go to 1 - if the user doesn't select a default app, the portal will keep asking a defined number of times and then stop asking, this is where this would matter - the number of times the portal should ask is saved in the permission store, we could just increase that number to some incredibly high number or even reset the number of times it has asked in the past from the portal impl to sidestep this problem.
> if a mime type has a default app the portal will use that No, that's true only for a few schemes. All other schemes and all file types get asked 3 times and then remembered for the app that attempted to open the URI/file. https://github.com/flatpak/xdg-desktop-portal/blob/main/src/open-uri.c#L478
That sucks. SO I guess the comment there is not entirely true https://github.com/flatpak/xdg-desktop-portal/issues/472#issuecomment-1423002949
They changed the logic multiple times during the years, it's possible it was the true back then. Or maybe he meant only http(s) URLs talking about firefox.
Apparently the latter given that https://github.com/flatpak/xdg-desktop-portal/issues/472#issuecomment-614701580 links the PR changing the logic to the current state.