summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-03-09 17:01:09 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:05:07 (GMT)
commit0c5d0fbc9f15c2b0f59851d64584a8183f8b4ff5 (patch)
tree65aa6f5589585077fe9d7f61fcd7f4311dc02362 /src/corelib
parent291962a745bc38c744400f2dd9b6c960d130a8e6 (diff)
downloadQt-0c5d0fbc9f15c2b0f59851d64584a8183f8b4ff5.zip
Qt-0c5d0fbc9f15c2b0f59851d64584a8183f8b4ff5.tar.gz
Qt-0c5d0fbc9f15c2b0f59851d64584a8183f8b4ff5.tar.bz2
Don't write byte-order-mark after seek()
Ideally, we should write a BOM after seek(0) if setGenerateByteOrderMark has been called, but we don't store that information. This commit is an improvement for the default case when generateByteOrderMark is false, and also when seeking to any other position than 0. Task-number: QTBUG-6295 Reviewed-by: Olivier (cherry picked from commit 7837de27309c958dc5a5985afc55492ec3054ee0)
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qtextstream.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index ac0d08b..139eb89 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -70,7 +70,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
have reached the end of the data stream, with stdin. The reason for this is
that as long as stdin doesn't give any input to the QTextStream, \c atEnd()
will return true even if the stdin is open and waiting for more characters.
-
+
Besides using QTextStream's constructors, you can also set the
device or string QTextStream operates on by calling setDevice() or
setString(). You can seek to a position by calling seek(), and
@@ -1196,6 +1196,7 @@ bool QTextStream::seek(qint64 pos)
resetCodecConverterStateHelper(&d->writeConverterState);
delete d->readConverterSavedState;
d->readConverterSavedState = 0;
+ d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
#endif
return true;
}