Commit 561a7416 authored by Lorenz Meier's avatar Lorenz Meier

Attempting to improve logging behaviour

parent e70c38bf
...@@ -61,8 +61,8 @@ void LogCompressor::run() ...@@ -61,8 +61,8 @@ void LogCompressor::run()
} }
// Verify that the output file is useable // Verify that the output file is useable
QTemporaryFile outTmpFile; QFile outTmpFile("processed_" + outFileName);
if (!outTmpFile.open()) { if (!outTmpFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
emit logProcessingStatusChanged(tr("Log Compressor: Cannot start/compress log file, since output file %1 is not writable").arg(QFileInfo(outTmpFile.fileName()).absoluteFilePath())); emit logProcessingStatusChanged(tr("Log Compressor: Cannot start/compress log file, since output file %1 is not writable").arg(QFileInfo(outTmpFile.fileName()).absoluteFilePath()));
return; return;
} }
...@@ -143,9 +143,9 @@ void LogCompressor::run() ...@@ -143,9 +143,9 @@ void LogCompressor::run()
infile.close(); infile.close();
// Make sure we remove the source file before replacing it. // Make sure we remove the source file before replacing it.
QFile::remove(outFileName); // QFile::remove(outFileName);
outTmpFile.copy(outFileName); // outTmpFile.copy(outFileName);
outTmpFile.close(); // outTmpFile.close();
emit logProcessingStatusChanged(tr("Log Compressor: Writing output to file %1").arg(QFileInfo(outFileName).absoluteFilePath())); emit logProcessingStatusChanged(tr("Log Compressor: Writing output to file %1").arg(QFileInfo(outFileName).absoluteFilePath()));
// Clean up and update the status before we return. // Clean up and update the status before we return.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment