| Summary: | KFileDialog: Slashes corrupt filter when converting from Qt | ||
|---|---|---|---|
| Product: | [Unmaintained] kfile | Reporter: | Felix Geyer <debfx-kde> |
| Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | andresbajotierra, mpyne |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Replace "/" with "\\/" in qt2KdeFilter() | ||
I can confirm the proximate bug, but it's not caused by the style directly. When using a KDE style Qt tries to use the native KDE file dialogs as well, which handles the filters differently, assuming the the slash represents a mimetype (so the cause is Qt "upgrading" VirtualBox's QFileDialog to a KFileDialog, but it's still a KDE bug). If you were to do this with a KDE application the filters would never work (the API docs for KFileDialog do refer to the mimetype filter assumption). I think it would be best to make the mimetype filter handling only take effect for valid mimetypes instead of just detecting "/". Created attachment 34711 [details]
Replace "/" with "\\/" in qt2KdeFilter()
Replacing "/" with "\\/" in qt2KdeFilter() fixes the bug.
Comment on attachment 34711 [details]
Replace "/" with "\\/" in qt2KdeFilter()
patch
Comment on attachment 34711 [details] Replace "/" with "\\/" in qt2KdeFilter() Submitted to Review Board: http://reviewboard.kde.org/r/934/ @Michael: any possibility of reviewing the patch before commiting ? SVN commit 1001314 by cfeck: Correctly handle slashes when converting filters from Qt Patch by Felix Geyer, reviewed by Albert Astals Cid See http://reviewboard.kde.org/r/934/ BUG: 197195 M +1 -1 kfiledialog.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1001314 SVN commit 1001316 by cfeck: Correctly handle slashes when converting filters from Qt (backport r1001314) CCBUG: 197195 M +1 -1 kfiledialog.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1001316 I'm late to the party but the patch looks good IMO. |
Version: (using KDE 4.2.4) OS: Linux Installed from: Ubuntu Packages When KFileDialog converts a Qt filter that contains slashes ('/') the resulting filter doesn't match any files. This happens when using Qt applications with the style set to Oxygen or QtCurve. Example: The VirtualBox frontend (written in Qt) uses the following filter: "CD/DVD-ROM images (*.iso);;All files (*)". When using the Oxygen style the displayed filter is ", , , " and it doesn't match any files. Other styles such as Plastique and GTK work fine. I suspect that slash have to be escaped to "\\/" (in qt2KdeFilter() ?).