]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Apply the file preview shadow frame to most previews instead of only image file previews
authorDiego Soenens <hyperz.2007@gmail.com>
Sat, 18 Feb 2017 21:43:01 +0000 (22:43 +0100)
committerEmmanuel Pescosta <emmanuelpescosta099@gmail.com>
Sat, 18 Feb 2017 21:43:01 +0000 (22:43 +0100)
The patch applies the shadow to all previews except for folders, fonts and
Win32 exe/dll previews, similar to how Windows and MacOS handles it.

REVIEW: 129918

src/kitemviews/kfileitemmodelrolesupdater.cpp

index 6e1c3d3ddd08a62d423665b2db6b2d1a446348f7..0d7f983113896758eb928ab258cbe846e4581932 100644 (file)
@@ -505,8 +505,12 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem& item, const QPi
 
     const QString mimeType = item.mimetype();
     const int slashIndex = mimeType.indexOf(QLatin1Char('/'));
 
     const QString mimeType = item.mimetype();
     const int slashIndex = mimeType.indexOf(QLatin1Char('/'));
-    const QString mimeTypeGroup = mimeType.left(slashIndex);
-    if (mimeTypeGroup == QLatin1String("image")) {
+    const bool isFontPreview = mimeType.right(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 (m_enlargeSmallPreviews) {
             KPixmapModifier::applyFrame(scaledPixmap, m_iconSize);
         } else {
         if (m_enlargeSmallPreviews) {
             KPixmapModifier::applyFrame(scaledPixmap, m_iconSize);
         } else {