diff --git a/src/libcalamaresui/utils/ImageRegistry.cpp b/src/libcalamaresui/utils/ImageRegistry.cpp index 86a9cf212..57683dbd0 100644 --- a/src/libcalamaresui/utils/ImageRegistry.cpp +++ b/src/libcalamaresui/utils/ImageRegistry.cpp @@ -34,17 +34,16 @@ ImageRegistry::icon( const QString& image, CalamaresUtils::ImageMode mode ) qint64 -ImageRegistry::cacheKey( const QSize& size, qreal opacity ) +ImageRegistry::cacheKey( const QSize& size ) { - return size.width() * 100 + size.height() * 10 + static_cast< qint64 >( opacity * 100.0 ); + return size.width() * 100 + size.height() * 10; } QPixmap ImageRegistry::pixmap( const QString& image, const QSize& size, - CalamaresUtils::ImageMode mode, - qreal opacity ) + CalamaresUtils::ImageMode mode ) { Q_ASSERT( !( size.width() < 0 || size.height() < 0 ) ); if ( size.width() < 0 || size.height() < 0 ) @@ -63,7 +62,7 @@ ImageRegistry::pixmap( const QString& image, { subsubcache = subcache.value( mode ); - const qint64 ck = cacheKey( size, opacity ); + const qint64 ck = cacheKey( size ); if ( subsubcache.contains( ck ) ) { return subsubcache.value( ck ); @@ -80,7 +79,6 @@ ImageRegistry::pixmap( const QString& image, p.fill( Qt::transparent ); QPainter pixPainter( &p ); - pixPainter.setOpacity( opacity ); svgRenderer.render( &pixPainter ); pixPainter.end(); @@ -114,7 +112,7 @@ ImageRegistry::pixmap( const QString& image, } } - putInCache( image, size, mode, opacity, pixmap ); + putInCache( image, size, mode, pixmap ); } return pixmap; @@ -125,7 +123,6 @@ void ImageRegistry::putInCache( const QString& image, const QSize& size, CalamaresUtils::ImageMode mode, - qreal opacity, const QPixmap& pixmap ) { QHash< qint64, QPixmap > subsubcache; @@ -140,7 +137,7 @@ ImageRegistry::putInCache( const QString& image, } } - subsubcache.insert( cacheKey( size, opacity ), pixmap ); + subsubcache.insert( cacheKey( size ), pixmap ); subcache.insert( mode, subsubcache ); s_cache.insert( image, subcache ); } diff --git a/src/libcalamaresui/utils/ImageRegistry.h b/src/libcalamaresui/utils/ImageRegistry.h index 87c73823f..4cf48968e 100644 --- a/src/libcalamaresui/utils/ImageRegistry.h +++ b/src/libcalamaresui/utils/ImageRegistry.h @@ -24,15 +24,13 @@ public: QIcon icon( const QString& image, CalamaresUtils::ImageMode mode = CalamaresUtils::Original ); QPixmap pixmap( const QString& image, const QSize& size, - CalamaresUtils::ImageMode mode = CalamaresUtils::Original, - qreal opacity = 1.0 ); + CalamaresUtils::ImageMode mode = CalamaresUtils::Original ); private: - qint64 cacheKey( const QSize& size, qreal opacity ); + qint64 cacheKey( const QSize& size ); void putInCache( const QString& image, const QSize& size, CalamaresUtils::ImageMode mode, - qreal opacity, const QPixmap& pixmap ); };