summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qtextstream.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-12-16 14:17:22 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-12-16 14:57:43 +0100
commitca062f6ed45acf83720faec8a211d9bf91705b2c (patch)
treec1fa410b516cc938ee1501bc3dc271ba6bcd3245 /src/corelib/io/qtextstream.cpp
parent66eec88591be2e8369e73dc5c86148cb4b09fad8 (diff)
don't report flush error when we didn't flush in the first place
this went unnoticed, as the return value is ignored - so far. Reviewed-by: mariusSO
Diffstat (limited to 'src/corelib/io/qtextstream.cpp')
-rw-r--r--src/corelib/io/qtextstream.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index f4731f91a9..560766a38e 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -693,7 +693,7 @@ bool QTextStreamPrivate::flushWriteBuffer()
// flush the file
#ifndef QT_NO_QOBJECT
QFile *file = qobject_cast<QFile *>(device);
- bool flushed = file && file->flush();
+ bool flushed = !file || file->flush();
#else
bool flushed = true;
#endif