KFileDialog::selectedFile's behaviour

Raphael Kubo da Costa kubito at gmail.com
Sat May 23 06:34:38 BST 2009


Hi there,

When using KFileDialog with setMode(KFile::File),
setOperationMode(KFileDialog::Saving) and passing a default mimetype
to setMimeFilter, the dialog only returns a filename with extension if
the name typed in the input box doesn't correspond to an existing
file.

So if you have foo and bar in your directory and pass
"application/x-compressed-tar" to setMimeFilter's default parameter,
entering "foobar" in the file name input box will make selectedFile()
return "/path/to/foobar.tar.gz", whereas entering "foo" will return
"/path/to/foo" and completely ignore the default extension passed,
possibly because foo already exists.

Is this behaviour a feature or a bug? ;)

Thanks,
Raphael




More information about the kde-core-devel mailing list