Bug 224586 - KFileDialog does not respect case for filter / file extension
Summary: KFileDialog does not respect case for filter / file extension
Status: RESOLVED FIXED
Alias: None
Product: kfile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-28 08:40 UTC by Thomas Capricelli
Modified: 2018-04-13 16:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2010-01-28 08:40:33 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

If the filter is set to "*.Foo", KFileDialog will change it to "*.foo": it displays the lower case version in the bottom text "Automatically select...", and will indeed use the lower case if the file is saved.
Using the exact same code under windows, the extension is displayed and used as expected, unchanged.

This is especially hurtful as it happens even from a Qt-only application.

I think this commit is kind of related as it introduces the toLower(), but i'm not sure of how to fix it.
http://websvn.kde.org/trunk/KDE/kdelibs/kio/kfile/kfiledialog.cpp?r1=948437&r2=948436&pathrev=948437

I'm not even sure you will consider it as a bug, though i think it is.
Comment 1 Christoph Feck 2010-01-28 22:10:39 UTC
Nearly all MIME types allow extensions in either case, so x.jpeg and x.JPEG are both considered the same extension. For the remaining extensions where case matters (such as .c vs .C), it would be possible to parse MIME database to find them.
Comment 2 Thomas Capricelli 2010-01-29 05:55:44 UTC
Though, the current KFileDialog will never write anything but lowercase extensions.

To accept files in a case-insensitve manner is one thing (ok), but not respecting the case given by the developer seems an unneeded technical limitation.
Comment 3 Thomas Capricelli 2010-08-15 01:48:42 UTC
The bug is still there in 4.5. We have several software here with long extension (>8 characters) and the case matters. We cannot save files with those extensions because of KDE. Fortunately the Qt file dialog is ok with this regard, so we can compile our software with Qt only, but sometimes this is still the KDE dialog that is used, and we have to rename files by hand afterward... really annoying :/
Comment 4 Nate Graham 2018-04-13 16:18:25 UTC
Works for me in KDE Frameworks 5.45. Saving (including for file extensions) is case-sensitive, while filtering is not. This seems sane.