diff options
author | Alex <prevedtest@gmail.com> | 2014-06-24 22:07:48 +0400 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-06-25 10:32:15 +0200 |
commit | 4e73618f6b8e878454b3e432217ffd9735003fbb (patch) | |
tree | 1983a3db0211bff7480a39f3a19064e4018c2b18 /src | |
parent | 8b875cb9054f8e6d44312ef6797367ad38275bb3 (diff) | |
download | qtimageformats-4e73618f6b8e878454b3e432217ffd9735003fbb.tar.gz |
Suppress "sequential device" warning for other files.
Hides "sequential device" warning for non-icns data.
Task-number: QTBUG-39838
Change-Id: Ib09f519de04a53e9d685b14412c40ee0077fb3d9
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/imageformats/icns/qicnshandler.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/imageformats/icns/qicnshandler.cpp b/src/plugins/imageformats/icns/qicnshandler.cpp index c6bff58..5daf29d 100644 --- a/src/plugins/imageformats/icns/qicnshandler.cpp +++ b/src/plugins/imageformats/icns/qicnshandler.cpp @@ -665,12 +665,15 @@ bool QICNSHandler::canRead(QIODevice *device) return false; } - if (device->isSequential()) { - qWarning("QICNSHandler::canRead() called on a sequential device"); - return false; + if (device->peek(4) == QByteArrayLiteral("icns")) { + if (device->isSequential()) { + qWarning("QICNSHandler::canRead() called on a sequential device"); + return false; + } + return true; } - return device->peek(4) == QByteArrayLiteral("icns"); + return false; } bool QICNSHandler::canRead() const |