Use KIO::PreviewJob::defaultPlugins() instead of hardcoding plugin list.
Depends on D8347
Use KIO::PreviewJob::defaultPlugins() instead of hardcoding plugin list.
Depends on D8347
Compiles fine in KDE Neon.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Please do make sure (just as a test before you push this) that the default plugins (which now is all except for the text plugin if i recall correctly) are enabled in Dolphin' settings (General -> Previews).
We cannot use new API without bumping the minimum KF5 version (currently 5.3, we need 5.40...)
Hmm, I hadn't thought about that. 5.40 isn't released yet, so if I change set(KF5_MIN_VERSION "5.3.0") in the CMake file, it seems that this would fail to build until 5.40 is released.
Should I back this out and re-commit after KF5.40 drops?
Or here's an idea: I could use KIO::PreviewJob::availablePlugins(), which differs from the new API I've added only in that it will also enable the text previewer plugin. Then we could switch to KIO::PreviewJob::defaultPlugins() once KF5.40 is released. Does that sound reasonable?
The alternative is to wrap the change with
#if KIO_VERSION >= QT_VERSION_CHECK(5, 40, 0)
without bumping the minimum version in cmake.
If we don't have KDE Frameworks 5.40 yet, emulate the behavior of the KIO::PreviewJob::defaultPlugins() API that we would otherwise want to use