From 4b6e8ac51b9b903fc55e87fb3db0aff9b2fa03d0 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 12 Apr 2015 15:45:34 +0200 Subject: safe file writer now ignores the hash if the file doesn't exist --- src/safewritefile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/safewritefile.cpp') diff --git a/src/safewritefile.cpp b/src/safewritefile.cpp index 3bc1d1c4..007b3da9 100644 --- a/src/safewritefile.cpp +++ b/src/safewritefile.cpp @@ -50,7 +50,8 @@ void SafeWriteFile::commit() { bool SafeWriteFile::commitIfDifferent(QByteArray &inHash) { QByteArray newHash = hash(); - if (newHash != inHash) { + if (newHash != inHash + || !QFile::exists(m_FileName)) { commit(); inHash = newHash; return true; -- cgit v1.3.1