Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kfileitemmodelrolesupdater.cpp
Show First 20 Lines • Show All 489 Lines • ▼ Show 20 Line(s) | 484 | { | |||
---|---|---|---|---|---|
490 | 490 | | |||
491 | const int index = m_model->index(item); | 491 | const int index = m_model->index(item); | ||
492 | if (index < 0) { | 492 | if (index < 0) { | ||
493 | return; | 493 | return; | ||
494 | } | 494 | } | ||
495 | 495 | | |||
496 | QPixmap scaledPixmap = pixmap; | 496 | QPixmap scaledPixmap = pixmap; | ||
497 | 497 | | |||
498 | const QString mimeType = item.mimetype(); | 498 | if (!pixmap.hasAlpha() | ||
499 | const int slashIndex = mimeType.indexOf(QLatin1Char('/')); | 499 | && m_iconSize.width() > KIconLoader::SizeSmallMedium | ||
broulik: Those parentheses are superfluous as you just do a conjunction for all of them; also move the… | |||||
500 | const bool isFontPreview = mimeType.rightRef(slashIndex).contains(QLatin1String("font")); | 500 | && m_iconSize.height() > KIconLoader::SizeSmallMedium) { | ||
501 | const bool isFolderPreview = item.isDir(); | | |||
502 | const bool isWindowsExePreview = mimeType == QLatin1String("application/x-ms-dos-executable") || | | |||
503 | mimeType == QLatin1String("application/x-msdownload"); | | |||
504 | | ||||
505 | if (!isFolderPreview && !isFontPreview && !isWindowsExePreview) { | | |||
506 | if (m_enlargeSmallPreviews) { | 501 | if (m_enlargeSmallPreviews) { | ||
507 | KPixmapModifier::applyFrame(scaledPixmap, m_iconSize); | 502 | KPixmapModifier::applyFrame(scaledPixmap, m_iconSize); | ||
508 | } else { | 503 | } else { | ||
509 | // Assure that small previews don't get enlarged. Instead they | 504 | // Assure that small previews don't get enlarged. Instead they | ||
510 | // should be shown centered within the frame. | 505 | // should be shown centered within the frame. | ||
511 | const QSize contentSize = KPixmapModifier::sizeInsideFrame(m_iconSize); | 506 | const QSize contentSize = KPixmapModifier::sizeInsideFrame(m_iconSize); | ||
512 | const bool enlargingRequired = scaledPixmap.width() < contentSize.width() && | 507 | const bool enlargingRequired = scaledPixmap.width() < contentSize.width() && | ||
513 | scaledPixmap.height() < contentSize.height(); | 508 | scaledPixmap.height() < contentSize.height(); | ||
▲ Show 20 Lines • Show All 685 Lines • Show Last 20 Lines |
Those parentheses are superfluous as you just do a conjunction for all of them; also move the operator to the beginning of the line