Add an option to allow slaves to determine mime type when using KIO::listDir
Currently, using KIO::listDir()
will not provide the mime type for
files. This means that calling KFileItem::mimeType()
will block the
calling thread to do mimetype resolution. Since the calling thread is
usually the GUI thread, this will block the UI. This is especially
noticable when listing a directory full of images in Gwenview's browse
mode.
To avoid this, allow the slave to determine mime type while listing the directory. USDEntry already supports including the mime type information, which we use to send this information back to the caller. Since this can slow down listing directories quite significantly, this is disabled by default and a flag is added to KCoreDirLister to enable this.
Support for this has been added to the file slave, but should also be added to several other slaves like remote file system protocols. When a slave does not implement this, behaviour will be the same as when the flag was not enabled.