Bug 382535

Summary: Impossible to predefine filters with --getopenfilename
Product: [Applications] kdialog Reporter: Nico Dorn <nicodorn>
Component: generalAssignee: Brad Hards <bradh>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 1.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nico Dorn 2017-07-20 12:03:24 UTC
The code below opens the expected dialog window but doesn't set the passed filters. Since it doesn't set any filters, no file can be selected - until one types the filters manually.

I think the bug was introduced with the latest revision of KDE Frameworks, i.e. version 5.36.0.

kdialog --getopenfilename /tmp/ ".tar.gz"
Comment 1 Nico Dorn 2017-07-20 12:12:31 UTC
Pardon me! It must have been introduced with KDE Applications 17.04.3, naturally. :)
Comment 2 Christoph Feck 2017-07-21 11:09:57 UTC
kdialog --getopenfile /tmp/ "Tar File (*.tar.gz)"
is the official glob type syntax and works. I am not sure if your glob without a name and a correct pattern worked because of a bug, or if it was a documented feature.
Comment 3 Nico Dorn 2017-07-21 11:27:53 UTC
Thanks for your answer! That works indeed. It used to work without wildcard. But it's correct to presume it's use.

So I'd say, this is not a bug, but I would like to propse to add another helpline to kdialog --help, since filters can be used for several functions. Something like that:

Arguments:
  [arg]      Arguments - depending on main option
  [filter]   File type filter - usage: "*.xml" or "XML file (*.xml)"