KFileItem::determineMimeType() is an explicit order to thoroughly detect the file type, so the result of the previous detections must be ignored. The indentation should be fixed after the if block is removed, I just didn't want to complicate this patch.
I also removed an unneeded const_cast.
CCBUG: 220496