Bug 450612 - Open/save dialog shows no files when app specifies its list of mimetypes with a glob
Summary: Open/save dialog shows no files when app specifies its list of mimetypes with...
Status: ASSIGNED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 6.0.4
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
: 470653 485866 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-20 14:32 UTC by Patrick Silva
Modified: 2024-11-04 19:54 UTC (History)
8 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 Patrick Silva 2022-02-20 14:32:19 UTC
SUMMARY
This bug as already reported in flathub bug tracker:
https://github.com/flathub/io.github.celluloid_player.Celluloid/issues/10
TingPing thinks it's a portal bug.

STEPS TO REPRODUCE
1. install Celluloid video player from flathub:
$flatpak install flathub io.github.celluloid_player.Celluloid
2. run Celluloid:
$flatpak run io.github.celluloid_player.Celluloid
3. click on '+' in the upper left corner and choose 'Open...'
4. try to find any media file in your file system

OBSERVED RESULT
we are unable to find any media file via file open dialog

EXPECTED RESULT
we are able to find and open media files via file open dialog

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.1
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Graphics Platform: Wayland

ADDITIONAL INFORMATION
output in Konsole when I try to open a file via fila open dialog:

$ flatpak run io.github.celluloid_player.Celluloid
Cannot load libcuda.so.1

(io.github.celluloid_player.Celluloid:2): Gdk-WARNING **: 11:22:38.493: Server is missing xdg_foreign support

(io.github.celluloid_player.Celluloid:2): Gtk-WARNING **: 11:22:38.494: Failed to export handle, could not set transient for

(io.github.celluloid_player.Celluloid:2): Gtk-WARNING **: 11:22:38.495: Failed to measure available space: Error getting filesystem info for /mnt/2TB: No such file or directory

(io.github.celluloid_player.Celluloid:2): Gtk-WARNING **: 11:22:38.495: Failed to measure available space: Error getting filesystem info for /mnt/WD: No such file or directory

(io.github.celluloid_player.Celluloid:2): Gtk-WARNING **: 11:22:38.495: Failed to measure available space: Error getting filesystem info for /mnt/WIN7: No such file or directory

(io.github.celluloid_player.Celluloid:2): Gtk-WARNING **: 11:22:38.495: Failed to measure available space: Error getting filesystem info for /mnt/SEAGATE: No such file or directory
Comment 1 Nicolas Fella 2022-02-20 17:24:08 UTC
The problem is that Celluloid passes mimetype filters with globs ("audio/*", "video/*", "images/*"), and KFileWidget doesn't handle those
Comment 2 Nicolas Fella 2022-02-20 17:25:10 UTC
In other words

KFileWidget w(QUrl("file:///home/nico/Music"));
w.setMimeFilter({"audio/*"});

doesn't work, but

KFileWidget w(QUrl("file:///home/nico/Music"));
w.setMimeFilter({"audio/mpeg"});

does
Comment 3 Nicolas Fella 2022-02-20 22:00:46 UTC
There's more:

Celluloid uses both filename glob based filters and mimetype filters, and KFileWidget can't handle both at the same time
Comment 4 Bug Janitor Service 2022-02-20 22:16:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/766
Comment 5 Nicolas Fella 2023-11-04 00:12:00 UTC
(In reply to Nicolas Fella from comment #3)
> There's more:
> 
> Celluloid uses both filename glob based filters and mimetype filters, and
> KFileWidget can't handle both at the same time

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/138 addresses that
Comment 6 Nicolas Fella 2023-11-07 16:57:20 UTC
Git commit e6ed8972d7fe64ce12bc8fa52993317f80d38160 by Nicolas Fella.
Committed on 07/11/2023 at 17:43.
Pushed by nicolasfella into branch 'master'.

[filedialog] Port to KFileFilter-based API

This matches what we get from the front-end more closely, thus simplifying the code and making it more correct

M  +63   -93   src/filechooser.cpp
M  +10   -5    src/filechooser.h

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/e6ed8972d7fe64ce12bc8fa52993317f80d38160
Comment 7 Justin Zobel 2023-11-20 01:56:54 UTC
(In reply to Nicolas Fella from comment #5)
> (In reply to Nicolas Fella from comment #3)
> > There's more:
> > 
> > Celluloid uses both filename glob based filters and mimetype filters, and
> > KFileWidget can't handle both at the same time
> 
> https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/138
> addresses that

This was merged, so is this now resolved?
Comment 8 Nicolas Fella 2023-11-20 02:00:38 UTC
No, there is still no support for globs, which is why I did not mark it as resolved
Comment 9 Nate Graham 2023-12-01 00:13:20 UTC
*** Bug 470653 has been marked as a duplicate of this bug. ***
Comment 10 Ilya Bizyaev 2024-04-21 14:55:40 UTC
*** Bug 485866 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2024-10-23 23:49:37 UTC
I can't reproduce this issue with the latest version of Celluloid anymore, FWIW. Perhaps they ported away from the use of globs.
Comment 14 Nicolas Fella 2024-10-24 16:22:52 UTC
No, this is a different issue entirely
Comment 15 Nicolas Fella 2024-10-24 16:41:01 UTC
This is about using mimetypes like "video/*", it has nothing to do with the "All files" type that Nate is seeing in Dragon.

The portal API isn't really clear whether this is something expected to be supported, so I opened https://github.com/flatpak/xdg-desktop-portal/discussions/1487 for clarification
Comment 16 Justin Zobel 2024-11-04 01:08:54 UTC
Nate can you confirm the patches actually did the right thing? Are they able to be cleanly applied on top of 24.08.2 or .3?
Comment 17 Nate Graham 2024-11-04 17:06:55 UTC
The patches in question fix an issue (the one blocking getting Dragon on Flathub), but apparently not this one, which was something else all along.
Comment 18 Justin Zobel 2024-11-04 19:54:29 UTC
Hmm OK. I'll try to find some time this week to attempt to apply them on top of the stable release tarball.