[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kio] src/widgets: Fix thumbnails for mimetype groups.
From:       Maarten De Meyer <de.meyer.maarten () gmail ! com>
Date:       2014-09-09 15:05:48
Message-ID: E1XRMzM-0003ZP-LP () scm ! kde ! org
[Download RAW message or body]

Git commit ae87a7d6999fc6ad90ab300dd8ea0c9c68c02bd4 by Maarten De Meyer.
Committed on 08/09/2014 at 21:58.
Pushed by demeyer into branch 'master'.

Fix thumbnails for mimetype groups.

KService::mimeTypes cannot handle mimetype groups. ex: text/*
Go back to KService::serviceTypes and remove 'ThumbCreator' entries.

REVIEW: 119958

M  +11   -6    src/widgets/previewjob.cpp

http://commits.kde.org/kio/ae87a7d6999fc6ad90ab300dd8ea0c9c68c02bd4

diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp
index 55a3fb7..ca47934 100644
--- a/src/widgets/previewjob.cpp
+++ b/src/widgets/previewjob.cpp
@@ -268,20 +268,25 @@ void PreviewJobPrivate::startPreview()
             protocols.append(p);
         }
         foreach (const QString &protocol, protocols) {
-            const QStringList mtypes = (*it)->mimeTypes();
+            // We cannot use mimeTypes() here, it doesn't support groups such as: \
text/* +            const QStringList mtypes = (*it)->serviceTypes();
             // Add supported mimetype for this protocol
             QStringList &_ms = m_remoteProtocolPlugins[protocol];
             foreach (const QString &_m, mtypes) {
-                protocolMap[protocol].insert(_m, *it);
-                if (!_ms.contains(_m)) {
-                    _ms.append(_m);
+                if (_m != QLatin1String("ThumbCreator")) {
+                    protocolMap[protocol].insert(_m, *it);
+                    if (!_ms.contains(_m)) {
+                        _ms.append(_m);
+                    }
                 }
             }
         }
         if (enabledPlugins.contains((*it)->desktopEntryName())) {
-            const QStringList mimeTypes = (*it)->mimeTypes();
+            const QStringList mimeTypes = (*it)->serviceTypes();
             for (QStringList::ConstIterator mt = mimeTypes.constBegin(); mt != \
                mimeTypes.constEnd(); ++mt) {
-                mimeMap.insert(*mt, *it);
+                if (*mt != QLatin1String("ThumbCreator")) {
+                    mimeMap.insert(*mt, *it);
+                }
             }
         }
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic