XmlLogHandler: Fix warning and output errors
This fixes the warning 'writeCurrentToken() with invalid state.', that appeared when the QXmlStreamReader had encountered errors. Now, it will be checked, if there were any reading errors before trying to write the new XML. Also there was a problem, that if the output was only one line (without '\n' at the end), the replacement didn't work and there was just removed one character of the XML header.
Showing with 6 additions and 3 deletions