Add missing switch case.
Add a utility function to write a random file.
Use a more Qt'ish folder recursing method, remove unused class.

Added unit test.