diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-06-15 11:06:19 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-06-15 12:33:51 (GMT) |
commit | df55141aa260c8a10c06aa990b6f20d6fb4718f3 (patch) | |
tree | 90b6e5c168b83232187ce61cc4e5ffbf530d6118 /src/gui/image/qbmphandler.cpp | |
parent | c28efecdcfdd5fa0049bf482cb102814338c0d99 (diff) | |
download | Qt-df55141aa260c8a10c06aa990b6f20d6fb4718f3.zip Qt-df55141aa260c8a10c06aa990b6f20d6fb4718f3.tar.gz Qt-df55141aa260c8a10c06aa990b6f20d6fb4718f3.tar.bz2 |
Fixed QImageReader::format() inconsistency.
If state is set to ReadHeader before canRead() then setFormat("png")
never gets called. We should make sure that setFormat() gets set
whenever canRead() returns true.
Task-number: QTBUG-2263
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/gui/image/qbmphandler.cpp')
-rw-r--r-- | src/gui/image/qbmphandler.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp index 42e19b8..074b8f0 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -674,13 +674,15 @@ bool QBmpHandler::readHeader() bool QBmpHandler::canRead() const { - if (state == Ready) { - if (!canRead(device())) - return false; + if (state == Ready && !canRead(device())) + return false; + + if (state != Error) { setFormat("bmp"); return true; } - return state != Error; + + return false; } bool QBmpHandler::canRead(QIODevice *device) |