summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qxbmhandler.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-06-15 11:06:19 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-06-15 12:33:51 (GMT)
commitdf55141aa260c8a10c06aa990b6f20d6fb4718f3 (patch)
tree90b6e5c168b83232187ce61cc4e5ffbf530d6118 /src/gui/image/qxbmhandler.cpp
parentc28efecdcfdd5fa0049bf482cb102814338c0d99 (diff)
downloadQt-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/qxbmhandler.cpp')
-rw-r--r--src/gui/image/qxbmhandler.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index 385340a..0dd4e99 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -261,13 +261,15 @@ bool QXbmHandler::readHeader()
bool QXbmHandler::canRead() const
{
- if (state == Ready) {
- if (!canRead(device()))
- return false;
+ if (state == Ready && !canRead(device()))
+ return false;
+
+ if (state != Error) {
setFormat("xbm");
return true;
}
- return state != Error;
+
+ return false;
}
bool QXbmHandler::canRead(QIODevice *device)