Commit 8b6c4e39 authored by Nathaniel Graham's avatar Nathaniel Graham

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
parent d257cf10
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment