summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Graham <[email protected]>2017-10-21 08:43:47 -0600
committerNathaniel Graham <[email protected]>2017-10-21 10:25:50 -0600
commit8b6c4e393bb07a9674718b0770b2acebdab63ed5 (patch)
tree03469b4f417c0ff24a7d91f17cc78c64f7834c35
parentd257cf109c5632530ef152b5650a01726b8ac264 (diff)
Use KIO::PreviewJob::defaultPlugins()
Summary: Use KIO::PreviewJob::defaultPlugins() instead of hardcoding plugin list. Depends on D8347 Test Plan: Compiles fine in KDE Neon. Reviewers: #frameworks, broulik, elvisangelaccio, markg Reviewed By: #frameworks, elvisangelaccio, markg Differential Revision: https://phabricator.kde.org/D8352
-rw-r--r--thumbnail/thumbnail.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/thumbnail/thumbnail.cpp b/thumbnail/thumbnail.cpp
index fceb7f8..6b25c19 100644
--- a/thumbnail/thumbnail.cpp
+++ b/thumbnail/thumbnail.cpp
@@ -663,7 +663,14 @@ bool ThumbnailProtocol::createSubThumbnail(QImage& thumbnail, const QString& fil
{
if (m_enabledPlugins.isEmpty()) {
const KConfigGroup globalConfig(KSharedConfig::openConfig(), "PreviewSettings");
+#if KIO_VERSION >= QT_VERSION_CHECK(5, 40, 0)
m_enabledPlugins = globalConfig.readEntry("Plugins", KIO::PreviewJob::defaultPlugins());
+#else
+ // We don't have KF5.40 yet; emulate the behavior of KIO::PreviewJob::defaultPlugins()
+ QStringList defaultPlugins = KIO::PreviewJob::availablePlugins();
+ defaultPlugins.removeAll(QStringLiteral("textthumbnail"));
+ m_enabledPlugins = globalConfig.readEntry("Plugins", defaultPlugins);
+#endif
}
const QMimeDatabase db;