diff options
Diffstat (limited to 'src/plugins/imageformats/ico')
-rw-r--r-- | src/plugins/imageformats/ico/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/plugins/imageformats/ico/qicohandler.cpp | 5 | ||||
-rw-r--r-- | src/plugins/imageformats/ico/qicohandler.h | 2 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/imageformats/ico/CMakeLists.txt b/src/plugins/imageformats/ico/CMakeLists.txt index 719696a77c..c9cd0f0d40 100644 --- a/src/plugins/imageformats/ico/CMakeLists.txt +++ b/src/plugins/imageformats/ico/CMakeLists.txt @@ -1,8 +1,6 @@ # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -# Generated from ico.pro. - ##################################################################### ## QICOPlugin Plugin: ##################################################################### @@ -17,7 +15,5 @@ qt_internal_add_plugin(QICOPlugin Qt::Core Qt::CorePrivate Qt::Gui + NO_UNITY_BUILD ) - -#### Keys ignored in scope 1:.:.:ico.pro:<TRUE>: -# OTHER_FILES = "ico.json" diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp index 3bcf30bfc6..18b39766f5 100644 --- a/src/plugins/imageformats/ico/qicohandler.cpp +++ b/src/plugins/imageformats/ico/qicohandler.cpp @@ -499,7 +499,7 @@ QImage ICOReader::iconAt(int index) if (!image.isNull()) { readBMP(image); if (!image.isNull()) { - if (icoAttrib.depth == 32) { + if (icoAttrib.nbits == 32) { img = std::move(image).convertToFormat(QImage::Format_ARGB32_Premultiplied); } else { QImage mask(image.width(), image.height(), QImage::Format_Mono); @@ -735,6 +735,8 @@ bool QtIcoHandler::supportsOption(ImageOption option) const */ bool QtIcoHandler::canRead() const { + if (knownCanRead) + return true; bool bCanRead = false; QIODevice *device = QImageIOHandler::device(); if (device) { @@ -744,6 +746,7 @@ bool QtIcoHandler::canRead() const } else { qCWarning(lcIco, "QtIcoHandler::canRead() called with no device"); } + knownCanRead = bCanRead; return bCanRead; } diff --git a/src/plugins/imageformats/ico/qicohandler.h b/src/plugins/imageformats/ico/qicohandler.h index 0fe251ab60..61c3eea465 100644 --- a/src/plugins/imageformats/ico/qicohandler.h +++ b/src/plugins/imageformats/ico/qicohandler.h @@ -30,7 +30,7 @@ public: private: int m_currentIconIndex; ICOReader *m_pICOReader; - + mutable bool knownCanRead = false; }; QT_END_NAMESPACE |