QPixmap scaledPixmap = pixmap;
- const QString mimeType = item.mimetype();
- const int slashIndex = mimeType.indexOf(QLatin1Char('/'));
- const bool isFontPreview = mimeType.rightRef(slashIndex).contains(QLatin1String("font"));
- const bool isFolderPreview = item.isDir();
- const bool isWindowsExePreview = mimeType == QLatin1String("application/x-ms-dos-executable") ||
- mimeType == QLatin1String("application/x-msdownload");
-
- if (!isFolderPreview && !isFontPreview && !isWindowsExePreview) {
+ if (!pixmap.hasAlpha()
+ && m_iconSize.width() > KIconLoader::SizeSmallMedium
+ && m_iconSize.height() > KIconLoader::SizeSmallMedium) {
if (m_enlargeSmallPreviews) {
KPixmapModifier::applyFrame(scaledPixmap, m_iconSize);
} else {
scaledPixmap);
scaledPixmap = largeFrame;
} else {
- // The image must be shrinked as it is too large to fit into
+ // The image must be shrunk as it is too large to fit into
// the available icon size
KPixmapModifier::applyFrame(scaledPixmap, m_iconSize);
}
}
} else {
- KPixmapModifier::scale(scaledPixmap, m_iconSize);
+ KPixmapModifier::scale(scaledPixmap, m_iconSize * qApp->devicePixelRatio());
+ scaledPixmap.setDevicePixelRatio(qApp->devicePixelRatio());
}
QHash<QByteArray, QVariant> data = rolesData(item);
// We need a reasonable upper limit for number of items to resolve after
// and before the visible range. m_maximumVisibleItems can be quite large
- // when using Compace View.
+ // when using Compact View.
const int readAheadItems = qMin(ReadAheadPages * m_maximumVisibleItems, ResolveAllItemsLimit / 2);
// Add items after the visible range.