summaryrefslogtreecommitdiff
path: root/src/safewritefile.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-04-12 15:45:34 +0200
committerTannin <devnull@localhost>2015-04-12 15:45:34 +0200
commit4b6e8ac51b9b903fc55e87fb3db0aff9b2fa03d0 (patch)
tree294c24c0608afe98e7213725423e9ab35ac6f6ed /src/safewritefile.cpp
parent8c2e88b9c90721557cef815696d5d0bf287420a0 (diff)
safe file writer now ignores the hash if the file doesn't exist
Diffstat (limited to 'src/safewritefile.cpp')
-rw-r--r--src/safewritefile.cpp3
1 files changed, 2 insertions, 1 deletions
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;