Another small one for macOS users ;-)
On macOS applications that work with documents can set a proxy icon on the window for the file you're currently editing. This allows a user to e.g. drag it into another application without having to browse to the file manually, among other neat things:
To display the correct icon for the file I removed the call to setWindowIcon on macOS, otherwise a Kate/KWrite icon would be shown at all times.