diff --git a/src/widgets/previewjob.h b/src/widgets/previewjob.h --- a/src/widgets/previewjob.h +++ b/src/widgets/previewjob.h @@ -189,10 +189,18 @@ * Returns a list of all available preview plugins. The list * contains the basenames of the plugins' .desktop files (no path, * no .desktop). - * @return the list of plugins + * @return the list of all available plugins */ static QStringList availablePlugins(); + /** + * Returns a list of plugins that should be enabled by default, which is all plugins + * Minus the plugins specified in an internal blacklist + * @return the list of plugins that should be enabled by default + * @since 5.40 + */ + static QStringList defaultPlugins(); + /** * Returns a list of all supported MIME types. The list can * contain entries like text/ * (without the space). diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp --- a/src/widgets/previewjob.cpp +++ b/src/widgets/previewjob.cpp @@ -735,6 +735,19 @@ return result; } +QStringList PreviewJob::defaultPlugins() +{ + QStringList blacklist = QStringList() + << QStringLiteral("textthumbnail"); + + QStringList defaultPlugins = availablePlugins(); + foreach (const QString plugin, blacklist) { + defaultPlugins.removeAll(plugin); + } + + return defaultPlugins; +} + QStringList PreviewJob::supportedMimeTypes() { QStringList result;