Bug 234313 - KFileDialog's Autocomplete Suggests Files Whose Filetypes Do Not Match Filter
Summary: KFileDialog's Autocomplete Suggests Files Whose Filetypes Do Not Match Filter
Status: RESOLVED FIXED
Alias: None
Product: kfile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 06:44 UTC by Jeffery MacEachern
Modified: 2018-04-13 15:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Picture of the bug manifesting itself (29.96 KB, image/png)
2010-04-14 06:45 UTC, Jeffery MacEachern
Details
How to use a filter (21.71 KB, image/png)
2010-04-18 12:00 UTC, Hans-Rudi Denzler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffery MacEachern 2010-04-14 06:44:04 UTC
Version:            (using KDE 4.4.2)
OS:                Linux
Installed from:    Unlisted Binary Package

Steps to Reproduce:
1) Open a file dialog in a KDE application (say, an Open File dialog) which has a filetype filter (say, ".h"), and browse to a folder which contains multiple files, some of which do not match the filter.
2) Start typing in the file name field, so that the autocompletion feature is activated.

Expected Behaviour:
Autocomplete should suggest files in the current directory which match both your input and the filetype filter (in this example, C/C++ headers).  The set of suggestible files should also correspond to the files which are shown in the dialog.

Actual Behaviour:
Autocomplete suggests anything which matches the input, regardless of filetype.  In fact, in doing this, it will suggest files that are not shown, *and* cannot actually be selected at all.  For example, I came across this while trying to open a header file without a .h extension in a dialog that filtered on said extension; it was a valid header, but even though KFileDialog suggested it, it would not let me open it.  (That's probably a *good* thing, but the lack of feedback had me confused for a few moments)

Reproducibility:
Always.
Comment 1 Jeffery MacEachern 2010-04-14 06:45:22 UTC
Created attachment 42765 [details]
Picture of the bug manifesting itself
Comment 2 Hans-Rudi Denzler 2010-04-14 11:44:44 UTC
You may use the Filter: right*.h   RETURN
Comment 3 Jeffery MacEachern 2010-04-18 08:30:34 UTC
"You may use the Filter: right*.h   RETURN"

I'm not sure what you mean...
Comment 4 Hans-Rudi Denzler 2010-04-18 12:00:23 UTC
Created attachment 42870 [details]
How to use a filter

http://doc.qt.nokia.com/4.6/qregexp.html
see Wildcard Matching
Comment 5 Hans-Rudi Denzler 2010-04-18 12:29:36 UTC
filter with blank (OR): a* b*
files like: aha OR blabla
The name field with auto completion is still useful.
Comment 6 Jeffery MacEachern 2010-04-18 12:38:40 UTC
I know what regular expressions are, and how filtering works; I was pointing out that having files that are not valid in the context (/and/ don't show up in the file list view) appear in autocomplete is confusing, and I can't see any good reason for it.  I'm not complaining about problems developing with KDELibs, but rather reporting a user-visible problem (as I see it).  My assumption was that the bug resided in the KDELibs file dialog, as I was able to reproduce it in several applications.  If I'm wrong about that, please correct the report, and if there's a good justification for the autocomplete behaviour, please enlighten me.
Comment 7 Hans-Rudi Denzler 2010-04-18 15:45:55 UTC
Maybe there are some c files/folders in current folder ?
Name: c
I use the Name field just for info [in]dependent of the actual filter.
Filter steps: a* -> a* b* -> a* b* c*

This is an example where the behavior makes sense.
"Name" relates to current folder.
"Filter" relates to the shown file list.
Comment 8 Hans-Rudi Denzler 2010-04-18 16:05:25 UTC
multi level filter with "find" in console:

> find . -name "*.cc" -a -name "hint*" | sort

Find in the current and sub folders all "*.cc" files AND only those starting with "hint".
Comment 9 Nate Graham 2018-04-13 15:55:26 UTC
Works for me in KDE Frameworks 5.45.