Bug 406450

Summary: "Remote" and "Recent" sections and "Trash" entry are missing in file open/save dialogs started by non-KDE Qt5/Qt6 apps
Product: [Plasma] plasma-integration Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: kdelibs-bugs, keigh.rim, kpschoedel, mcarans, meven29, nate
Priority: NOR    
Version: 6.0.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=407316
https://bugs.kde.org/show_bug.cgi?id=415019
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: SimpleScreenRecorder - missing sections and "Trash" entry
Kate - all sections/entires are present in the places panel
OpenShot from Arch repos - several entries/sections are missing
OpenShot from flathub - all entries/sections are present as expected
kdialog: --getopenurl vs --getopenfilename

Description Patrick Silva 2019-04-11 21:34:30 UTC
Created attachment 119361 [details]
SimpleScreenRecorder - missing sections and "Trash" entry

SUMMARY
KDE apps show all sections/entries in the places panel.
However, both "Remote" and "Removable devices" sections and "Trash" entry are missing in file open/save dialogs started by non-KDE Qt5 apps.

STEPS TO REPRODUCE
1. install some non-KDE Qt5 app (SimpleScreenRecorder or qBittorrent, for example)
2. start its file open/save dialogs
3. observe the sections/entries present in the places panel

OBSERVED RESULT
As we can see in the screenshot of SimpleScreenRecorder,
both "Remote" and "Removable devices" sections and "Trash" entry
are missing in the places panel.

EXPECTED RESULT
file open/save dilaogs started by non-KDE Qt5 apps should be the same as the dialogs started by KDE apps like Kate.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2


ADDITIONAL INFORMATION
the following non-KDE Qt5 apps are afeected on my system:
qmmp player
mkvtoolnix
picard tag editor
quiterss
qbittorrent
smplayer
ffmulticonverter
simplescreenrecorder
Comment 1 Patrick Silva 2019-04-11 21:35:49 UTC
Created attachment 119362 [details]
Kate - all sections/entires are present in the places panel
Comment 2 Christoph Feck 2019-04-12 07:49:59 UTC
Those applications are not using KIO. They won't be able to access URLs.
Comment 3 Patrick Silva 2019-04-12 10:35:23 UTC
What are they using?
Comment 4 Christoph Feck 2019-04-12 12:08:11 UTC
They are using QFile or POSIX calls. These can only access local files and remote files mounted locally (via FUSE). There is no KDE tool yet to perform the mounts automatically (what GVFS does), see bug 75324.
Comment 5 Patrick Silva 2019-04-12 12:12:50 UTC
Will a fix for bug 75324 solve the problem described here?
Comment 6 Christoph Feck 2019-04-12 12:30:53 UTC
That's part of the plan, yes. When KIO automatically mounts URLs to local paths, the file dialog commits can be reverted to no longer hide those for non-KIO applications, but show the hidden local paths instead.
Comment 7 Patrick Silva 2020-04-25 15:56:40 UTC
Created attachment 127865 [details]
OpenShot from Arch repos - several entries/sections are missing

(In reply to Christoph Feck from comment #6)
> That's part of the plan, yes. When KIO automatically mounts URLs to local
> paths, the file dialog commits can be reverted to no longer hide those for
> non-KIO applications, but show the hidden local paths instead.

Were the file dialogs commits already reverted?
I have noticed that some entries/sections (Trash, Remote, Recent, Search for and
All tags" under Tags section) are missing in the side bar of file dialogs of non-KDE Qt5
apps installed from distribution repositories but the same apps installed
via flathub/flatpak show all the entries/sections in their file dialogs as expected.
This is the case of the following apps:
photoflare
qbittorrent
notepadqq
clementine
mkvtoolnix
avidemux
openshot

The attached screenshots show the OpenShot case.

Operating System: Arch Linux 
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2
Comment 8 Patrick Silva 2020-04-25 15:57:25 UTC
Created attachment 127866 [details]
OpenShot from flathub - all entries/sections are present as expected
Comment 9 Patrick Silva 2020-11-13 13:11:34 UTC
(In reply to Patrick Silva from comment #7)
> Created attachment 127865 [details]
> OpenShot from Arch repos - several entries/sections are missing
> 
> (In reply to Christoph Feck from comment #6)
> > That's part of the plan, yes. When KIO automatically mounts URLs to local
> > paths, the file dialog commits can be reverted to no longer hide those for
> > non-KIO applications, but show the hidden local paths instead.
> 
> Were the file dialogs commits already reverted?
> I have noticed that some entries/sections (Trash, Remote, Recent, Search for
> and
> All tags" under Tags section) are missing in the side bar of file dialogs of
> non-KDE Qt5
> apps installed from distribution repositories but the same apps installed
> via flathub/flatpak show all the entries/sections in their file dialogs as
> expected.
> This is the case of the following apps:
> photoflare
> qbittorrent
> notepadqq
> clementine
> mkvtoolnix
> avidemux
> openshot
> 
> The attached screenshots show the OpenShot case.
> 
> Operating System: Arch Linux 
> KDE Plasma Version: 5.18.4
> KDE Frameworks Version: 5.69.0
> Qt Version: 5.14.2

This issue persists. Any comment on it?

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.20.80
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.1
Comment 10 Patrick Silva 2022-09-24 17:24:40 UTC
This bug persists. The following apps are affected:
photoflare
clementine
avidemux
openshot
picard music tag editor

Operating System: Arch Linux
KDE Plasma Version: 5.25.90
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 11 mcarans 2022-11-24 23:08:51 UTC
I added a "place" in Dolphin that doesn't show up under places in either the Kate or Chrome save dialog.
Comment 12 mcarans 2022-11-24 23:15:38 UTC
(In reply to mcarans from comment #11)
> I added a "place" in Dolphin that doesn't show up under places in either the
> Kate or Chrome save dialog.

Actually this is a different bug since I see earlier the reporter compared with Kate. I will make a new issue.
Comment 13 kpschoedel 2023-05-07 16:11:29 UTC
I don't think this is specific to non-KDE apps, since it can be demonstrated using `kdialog`. Run `kdialog --getopenurl`, and Recents, Trash, etc. are present. Run `kdialog --getopenfilename` and they're missing.

I don't know KDE internals, but I suspect that this is because Recents et al are implemented internally as URLs (e.g. `recentlyused:`), so they are incorrectly blocked from the ‘filename’ versions, even though they aren't going to be *returned* from the dialog, only used for navigation within it.
Comment 14 kpschoedel 2023-05-07 16:13:40 UTC
Created attachment 158755 [details]
kdialog: --getopenurl vs --getopenfilename
Comment 15 Méven Car 2023-05-17 07:45:39 UTC
(In reply to kpschoedel from comment #13)
> I don't think this is specific to non-KDE apps, since it can be demonstrated
> using `kdialog`. Run `kdialog --getopenurl`, and Recents, Trash, etc. are
> present. Run `kdialog --getopenfilename` and they're missing.
> 
> I don't know KDE internals, but I suspect that this is because Recents et al
> are implemented internally as URLs (e.g. `recentlyused:`), so they are
> incorrectly blocked from the ‘filename’ versions, even though they aren't
> going to be *returned* from the dialog, only used for navigation within it.

That's accurate.

Remote could be supported using kio-fuse, but trash should not be.
Comment 16 Patrick Silva 2024-03-09 16:26:35 UTC
I have tested several non-KDE Qt5 apps on Plasma 6.0.1, SMPlayer and Avidemux video editor are the only ones affected.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Graphics Platform: Wayland
Comment 17 Patrick Silva 2024-03-09 16:38:33 UTC
The non-KDE Qt5 apps are also affected:
openshot video editor
photoflare photo editor
clementine music player

This also affects non-KDE Qt6 apps.
Comment 18 Méven Car 2024-03-11 10:55:56 UTC
(In reply to Patrick Silva from comment #17)
> The non-KDE Qt5 apps are also affected:
> openshot video editor
> photoflare photo editor
> clementine music player
> 
> This also affects non-KDE Qt6 apps.

It seems like plasma-integration is not properly loading the plugins that provide those features (kio_trash.so, kio_recentlyused.so).
We probably need to use `QCoreApplication::addLibraryPath` to make sure /usr/lib/plugins/kf6 is added to the a plugin paths.

This can fix only the case where plasma-integration Qt version, kio Qt version and the application Qt version match.
Note we can install kio/Qt5 in parallel to kio/Qt6.