diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-09-07 10:45:07 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-09-07 11:56:30 (GMT) |
commit | 73da1fd9ff3e316dca3367a013f41b2488ac4081 (patch) | |
tree | 8e046015d8d0d38e1a8b6834fa6dfb82534e0d04 /src/corelib/io/qiodevice.cpp | |
parent | fd4e745c99fc5fbb4debefdd66122e65b68d60a3 (diff) | |
download | Qt-73da1fd9ff3e316dca3367a013f41b2488ac4081.zip Qt-73da1fd9ff3e316dca3367a013f41b2488ac4081.tar.gz Qt-73da1fd9ff3e316dca3367a013f41b2488ac4081.tar.bz2 |
QDataStream doesn't check return values from QIODevice::write
QDataStream does not check values from QIODevice::write and QIODevice::read
since it cannot decide what to do in case of errors or less data written
or read. The fix for this is to fix the documentation for
QIODevice::writeData and QIODevice::readData to make sure implementations
write and read all the requested data.
Task-number: QTBUG-13108
Reviewed-by: David Boddie
Diffstat (limited to 'src/corelib/io/qiodevice.cpp')
-rw-r--r-- | src/corelib/io/qiodevice.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 26e587d..8544fba 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -1633,6 +1633,12 @@ QString QIODevice::errorString() const This function is called by QIODevice. Reimplement this function when creating a subclass of QIODevice. + When reimplementing this function it is important that this function + reads all the required data before returning. This is required in order + for QDataStream to be able to operate on the class. QDataStream assumes + all the requested information was read and therefore does not retry reading + if there was a problem. + \sa read() readLine() writeData() */ @@ -1645,6 +1651,12 @@ QString QIODevice::errorString() const This function is called by QIODevice. Reimplement this function when creating a subclass of QIODevice. + When reimplementing this function it is important that this function + writes all the data available before returning. This is required in order + for QDataStream to be able to operate on the class. QDataStream assumes + all the information was written and therefore does not retry writing if + there was a problem. + \sa read() write() */ |