Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kfileitemmodelrolesupdater.cpp
Show First 20 Lines • Show All 493 Lines • ▼ Show 20 Line(s) | 484 | { | |||
---|---|---|---|---|---|
494 | } | 494 | } | ||
495 | 495 | | |||
496 | QPixmap scaledPixmap = pixmap; | 496 | QPixmap scaledPixmap = pixmap; | ||
497 | 497 | | |||
498 | const QString mimeType = item.mimetype(); | 498 | const QString mimeType = item.mimetype(); | ||
499 | const int slashIndex = mimeType.indexOf(QLatin1Char('/')); | 499 | const int slashIndex = mimeType.indexOf(QLatin1Char('/')); | ||
500 | const bool isFontPreview = mimeType.rightRef(slashIndex).contains(QLatin1String("font")); | 500 | const bool isFontPreview = mimeType.rightRef(slashIndex).contains(QLatin1String("font")); | ||
501 | const bool isFolderPreview = item.isDir(); | 501 | const bool isFolderPreview = item.isDir(); | ||
502 | const bool isIconCandidate = (mimeType == QLatin1String("image/png") || | ||||
503 | mimeType == QLatin1String("image/svg+xml") || | ||||
504 | mimeType == QLatin1String("image/svg+xml-compressed")) && | ||||
505 | scaledPixmap.width() == scaledPixmap.height() && | ||||
506 | (scaledPixmap.width() & 0x7) == 0; | ||||
507 | const bool isAppImagePreview = mimeType == QLatin1String("application/x-appimage") || | ||||
508 | mimeType == QLatin1String("application/vnd.appimage"); | ||||
502 | const bool isWindowsExePreview = mimeType == QLatin1String("application/x-ms-dos-executable") || | 509 | const bool isWindowsExePreview = mimeType == QLatin1String("application/x-ms-dos-executable") || | ||
503 | mimeType == QLatin1String("application/x-msdownload"); | 510 | mimeType == QLatin1String("application/x-msdownload"); | ||
504 | 511 | | |||
505 | if (!isFolderPreview && !isFontPreview && !isWindowsExePreview) { | 512 | if (!isFontPreview && | ||
513 | !isFolderPreview && | ||||
broulik: Those parentheses are superfluous as you just do a conjunction for all of them; also move the… | |||||
514 | !isIconCandidate && | ||||
515 | !isAppImagePreview && | ||||
516 | !isWindowsExePreview) { | ||||
506 | if (m_enlargeSmallPreviews) { | 517 | if (m_enlargeSmallPreviews) { | ||
507 | KPixmapModifier::applyFrame(scaledPixmap, m_iconSize); | 518 | KPixmapModifier::applyFrame(scaledPixmap, m_iconSize); | ||
508 | } else { | 519 | } else { | ||
509 | // Assure that small previews don't get enlarged. Instead they | 520 | // Assure that small previews don't get enlarged. Instead they | ||
510 | // should be shown centered within the frame. | 521 | // should be shown centered within the frame. | ||
511 | const QSize contentSize = KPixmapModifier::sizeInsideFrame(m_iconSize); | 522 | const QSize contentSize = KPixmapModifier::sizeInsideFrame(m_iconSize); | ||
512 | const bool enlargingRequired = scaledPixmap.width() < contentSize.width() && | 523 | const bool enlargingRequired = scaledPixmap.width() < contentSize.width() && | ||
513 | scaledPixmap.height() < contentSize.height(); | 524 | 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