DirModel to build on Qt5

I forgot the changes for DirModel in previous pull request. I'm not totally happy with these changes, but couldn't come up with a cleaner solution.