]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/informationpanelcontent.cpp
Port away from deprecated KIconEffect API
[dolphin.git] / src / panels / information / informationpanelcontent.cpp
index 86a569a866809e09cb21d8c69e49f503ffd74bba..70d85a40211f2f3c928c07b391f76a517035fafa 100644 (file)
@@ -411,8 +411,15 @@ void InformationPanelContent::markOutdatedPreview()
         // use it until the preview is done
         showIcon(m_item);
     } else {
-        KIconEffect *iconEffect = KIconLoader::global()->iconEffect();
-        QPixmap disabledPixmap = iconEffect->apply(m_preview->pixmap(), KIconLoader::Desktop, KIconLoader::DisabledState);
+#if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+        QPixmap disabledPixmap = m_preview->pixmap();
+        KIconEffect::toDisabled(disabledPixmap);
+#else
+        QImage img = m_preview->pixmap().toImage();
+        KIconEffect::toGray(img, 1);
+        KIconEffect::semiTransparent(img);
+        QPixmap disabledPixmap = QPixmap::fromImage(img);
+#endif
         m_preview->setPixmap(disabledPixmap);
     }
 }