diff options
author | aavit <qt-info@nokia.com> | 2010-03-19 14:13:04 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-03-19 14:13:04 (GMT) |
commit | ff66d8bb392db5e76409ecbe4e25785e896d950e (patch) | |
tree | 2d64aa6ec5b370a62e73244c04e9d5a1c19550ff /src/gui | |
parent | 83b8d1aef2a840838bbe530794e1dd004e3a22d5 (diff) | |
download | Qt-ff66d8bb392db5e76409ecbe4e25785e896d950e.zip Qt-ff66d8bb392db5e76409ecbe4e25785e896d950e.tar.gz Qt-ff66d8bb392db5e76409ecbe4e25785e896d950e.tar.bz2 |
Let QImageReader open the device if it is not open already
This brings the actual behaviour in line with the doc of setDevice().
Reviewed-by: Trond
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qimagereader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 9320cfc..27f9627 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -503,7 +503,7 @@ QImageReaderPrivate::~QImageReaderPrivate() bool QImageReaderPrivate::initHandler() { // check some preconditions - if (!device || (!deleteDevice && !device->isOpen())) { + if (!device || (!deleteDevice && !device->isOpen() && !device->open(QIODevice::ReadOnly))) { imageReaderError = QImageReader::DeviceError; errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageReader, "Invalid device")); return false; |