Implement QPlatformTheme::fileIconPixmap() to make QFileIconProvider work.
It pains me a bit to say this since it looks like you've spend quite a bit of time writing that code.
But please do look at KIO::iconNameForUrl  (like also suggested by Kai on reviewboard). Much of the code can likely be replaced by just using that instead.
I would rather not support DontUseCustomDirectoryIcons than reimplementing all of this logic :) Perhaps we could just special-case it for inode/directory to return a generic folder icon.