kdeui: convert KIconLoaderPrivate::overlaySize() to static method

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-06-04 00:22:56 +03:00
parent 4ea318b347
commit 9c4a2560c4

View file

@ -259,7 +259,7 @@ public:
* @internal * @internal
* Returns size suitable for overlay image based on the width and height of @p size. * Returns size suitable for overlay image based on the width and height of @p size.
*/ */
int overlaySize(const QSize &size) const; static int overlaySize(const QSize &size);
KIconLoader *const q; KIconLoader *const q;
@ -790,7 +790,7 @@ bool KIconLoaderPrivate::findCachedPixmapWithPath(const QString &key, QPixmap &d
return false; return false;
} }
int KIconLoaderPrivate::overlaySize(const QSize &size) const int KIconLoaderPrivate::overlaySize(const QSize &size)
{ {
const int minSize = qMin(size.width(), size.height()); const int minSize = qMin(size.width(), size.height());
if (minSize < 32) { if (minSize < 32) {
@ -1116,7 +1116,7 @@ QPixmap KIconLoader::loadIcon(const QString& _name, KIconLoader::Group group, in
} }
// ensure the icon size is suitable for overlay // ensure the icon size is suitable for overlay
const int iconSize = d->overlaySize(img.size()); const int iconSize = KIconLoaderPrivate::overlaySize(img.size());
favIcon = favIcon.scaled(QSize(iconSize, iconSize), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); favIcon = favIcon.scaled(QSize(iconSize, iconSize), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPainter p(&img); QPainter p(&img);