Bug 407316 - [RFE] recentdocuments:/ ioslave does not work in open dialog using XDG portal in Firefox
Summary: [RFE] recentdocuments:/ ioslave does not work in open dialog using XDG portal...
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-07 21:23 UTC by Nate Graham
Modified: 2020-11-19 16:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2019-05-07 21:23:30 UTC
STEPS TO REPRODUCE
1. Save an image file somewhere in your home directory
1. Navigate to https://imgur.com/upload
2. Click the "Browse" button so that the file dialog opens
3. In the file dialog's URL bar, enter "recentdocuments:/" to navigate to the Recent Documents IOSlave
4. Select the recently-saved image in the file view, and click "Open" to choose it and close the file dialog


OBSERVED RESULT
The file is not actually passed to the website.


EXPECTED RESULT
The file is passed to the website properly.


VERSIONS
Plasma 5.15.5 with Firefox 66.0.3 using native KDE file dialogs by setting GTK_USE_PORTAL=1 in the enfironment
Comment 1 Jan Grulich 2019-05-10 11:19:36 UTC
I'm afraid this combination will not work, the reason is that the url returned is e.g. "recentdocuments://your_filename.png" which won't be handled by portals. For this reason we support only local filenames (paths using e.g. file://foo.png).

I can leave this open in case portals will change and we will be able to support this.
Comment 2 Nate Graham 2019-05-10 18:03:19 UTC
Is there some way we could have the IOSlave translate that URL into a local path when running in the portal? Heck, maybe it should always do that...
Comment 3 Christoph Feck 2019-05-11 10:29:29 UTC
This is bug 406450, which in turn is bug 75324.

KDE applications have a way to get the local URL for KIO URLs that are actually local (e.g. trash:/, desktop:/, etc.), but non-KDE applications don't use this API.

https://api.kde.org/frameworks/kio/html/classKIO_1_1StatJob.html#a4393f0c1cf278dc6aa8b09789497ec05
Comment 4 Nate Graham 2019-05-13 21:37:46 UTC
Thanks, but I'm not sure I agree that fixing this requires implementing Bug 75324. That would be great of course, but couldn't KIO just detect that the calling app was non-KIO-aware and translate the ioslave's URI into a local path instead?
Comment 5 Patrick Silva 2020-11-18 09:03:21 UTC
I can't reproduce this bug with Firefox 82 on neon unstable.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.1
Comment 6 Nate Graham 2020-11-19 16:56:54 UTC
I can't test anymore as my XDG portal dialog on openSUSE Tumbleweed has temporarily broken, but I'll take your word for it!