Bug 463309 - Filter field in save dialog after kio 5.101 is empty
Summary: Filter field in save dialog after kio 5.101 is empty
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: 5.101.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
: 463535 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-12-21 16:34 UTC by Ogden
Modified: 2023-01-11 22:44 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Save dialog in Krita app (12.89 KB, image/jpeg)
2022-12-21 16:34 UTC, Ogden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ogden 2022-12-21 16:34:07 UTC
Created attachment 154729 [details]
Save dialog in Krita app

STEPS TO REPRODUCE
1. Open application that uses kio (such as Krita, Ocenaudio, etc)
2. Try to save a current document
3. Go to File -> Save/Save As
4. Click on the Filter dropdown menu

OBSERVED RESULT
All the fields are empty.

EXPECTED RESULT
List of all supported file types.  

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Artix Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION

Here's a terminal log taken from Krita

Invalid profile :  "/usr/share/color/icc/colord/Crayons.icc"
Invalid profile :  "/usr/share/color/icc/colord/x11-colors.icc"
QObject::startTimer: Timers cannot have negative intervals
/usr/lib/krita-python-libs/krita added to PYTHONPATH
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
kf.kio.filewidgets.kfilefiltercombo: Could not find filter " *.kra *.krz |Krita document "
krita.lib.widgetutils: KoFileDialog::onFilterSelected: Cannot find suffix for filter ""
krita.lib.widgetutils: KoFileDialog::onFilterSelected: Cannot find suffix for filter ""
kf.kio.filewidgets.kfilefiltercombo: Could not find filter " *.kra *.krz |Krita document "
krita.lib.widgetutils: KoFileDialog::onFilterSelected: Cannot find suffix for filter ""
libpng warning: iCCP: known incorrect sRGB profile
krita.lib.widgetutils: KoFileDialog::onFilterSelected: Cannot find suffix for filter "*.krz"
QFSFileEngine::open: No file name specified
Comment 1 Nicolas Fella 2022-12-22 15:23:12 UTC
Can't reproduce, works fine here
Comment 2 Nicolas Fella 2022-12-28 13:11:39 UTC
*** Bug 463544 has been marked as a duplicate of this bug. ***
Comment 3 Nicolas Fella 2022-12-28 13:11:49 UTC
*** Bug 463535 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2022-12-28 14:21:09 UTC
Can reproduce on Neon user edition
Comment 5 Bug Janitor Service 2022-12-28 16:59:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1092
Comment 6 Bug Janitor Service 2022-12-29 01:08:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1095
Comment 7 David Faure 2023-01-11 22:44:25 UTC
Git commit adad3bec21ebbc886f45ec2ae6065d6b6070fa93 by David Faure, on behalf of Nicolas Fella.
Committed on 11/01/2023 at 22:43.
Pushed by dfaure into branch 'master'.

Restore old behavior for KFileFilterCombo::setFilter

fb2a2268dbb2033bb8483d9bee63cb11f914573e refactored it to use the newly introduced KFileFilter
class to parse the input. However, it actually allows input that is not a valid filter string expression.

For example K3B uses filters like "audio/x-wav |Wave Sound Files", which are now parsed incorrectly.

Also, contrary to KFileWidget's filter strings slashes were allowed unescapted, which broke Krita.

K3B's usage of KFileFilterCombo for this is somewhat questionable, but we should not break it regardless.

Longer-term setFilter should be replaced with API that takes a KFileFilter object to avoid such confusion

Revert the implementation of setFilter to the original one. For setMimeFilter the usage of KFileFilter is fine.
That means we now have separate codepaths for when setFilter and setMimeFilter was called. Longer-term there will
be only one using KFileFilter

M  +20   -0    autotests/kfilefiltercombotest.cpp
M  +45   -19   src/filewidgets/kfilefiltercombo.cpp

https://invent.kde.org/frameworks/kio/commit/adad3bec21ebbc886f45ec2ae6065d6b6070fa93
Comment 8 David Faure 2023-01-11 22:44:56 UTC
Git commit c576a6e53b8d14b584525ac6241f952eb53446ea by David Faure, on behalf of Nicolas Fella.
Committed on 11/01/2023 at 22:44.
Pushed by dfaure into branch 'kf5'.

Restore old behavior for KFileFilterCombo::setFilter

fb2a2268dbb2033bb8483d9bee63cb11f914573e refactored it to use the newly introduced KFileFilter
class to parse the input. However, it actually allows input that is not a valid filter string expression.

For example K3B uses filters like "audio/x-wav |Wave Sound Files", which are now parsed incorrectly.

Also, contrary to KFileWidget's filter strings slashes were allowed unescapted, which broke Krita.

K3B's usage of KFileFilterCombo for this is somewhat questionable, but we should not break it regardless.

Longer-term setFilter should be replaced with API that takes a KFileFilter object to avoid such confusion

Revert the implementation of setFilter to the original one. For setMimeFilter the usage of KFileFilter is fine.
That means we now have separate codepaths for when setFilter and setMimeFilter was called. Longer-term there will
be only one using KFileFilter
(cherry picked from commit adad3bec21ebbc886f45ec2ae6065d6b6070fa93)

M  +20   -0    autotests/kfilefiltercombotest.cpp
M  +45   -19   src/filewidgets/kfilefiltercombo.cpp

https://invent.kde.org/frameworks/kio/commit/c576a6e53b8d14b584525ac6241f952eb53446ea