KCoreDirLister::setMimeExcludeFilter()

Jonathan Marten jjm2 at keelhaul.me.uk
Wed Apr 26 17:09:44 BST 2023


Hello,

This has been deprecated in 5.100 with the comment "no known users".
Unfortunately there is a use in Kooka, where it is used to configure a
KDirOperator (via its KDirLister) to only show files and not
directories.  This happens at

https://invent.kde.org/graphics/kooka/-/blob/master/app/thumbview.cpp#L84

Although KDirOperator has setMode(KFile::Modes), setting this to
KFile::File or KFile::Files seems to only affect the selection mode and
does not stop directories from being shown.

The API doc for KCoreDirLister::setMimeExcludeFilter() says "Filtering
should be done with KFileFilter", but from the current KFileFilter doc
it appears that this will only be able to be an "include this file or
MIME type type" filter, not an "exclude" one.

Is there currently - or will there be in the future - a way to configure
a KDirOperator in a "files only" mode, in the same way as "directories
only" is currently supported?  If it turns out that KDirOperator::setMode()
is intended to be have that effect, then I'd be happy to investigate why
it doesn't.

Best regards,
-- 
Jonathan Marten                         http://www.keelhaul.me.uk
Twickenham, UK                          jjm at keelhaul.me.uk


More information about the kde-core-devel mailing list