diff options
| author | Alexander Lohnau <[email protected]> | 2021-12-27 17:31:17 +0100 |
|---|---|---|
| committer | Alexander Lohnau <[email protected]> | 2022-01-04 17:07:38 +0000 |
| commit | dafa1e1f20d96a5704a63f645888cc7eeb5ed81d (patch) | |
| tree | ccf6d4905a599a25fda54c9569a0cf7babbde8a9 | |
| parent | 9185c5128e7bed4803ded72f1e3c3d7921f7e320 (diff) | |
Utilize KIO::PreviewJob::availableThumbnailerPlugins method to fetch available preview plugins
| -rw-r--r-- | src/settings/general/previewssettingspage.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/settings/general/previewssettingspage.cpp b/src/settings/general/previewssettingspage.cpp index 5d176f465..f12338aef 100644 --- a/src/settings/general/previewssettingspage.cpp +++ b/src/settings/general/previewssettingspage.cpp @@ -168,17 +168,17 @@ void PreviewsSettingsPage::loadPreviewPlugins() { QAbstractItemModel* model = m_listView->model(); - const KService::List plugins = KServiceTypeTrader::self()->query(QStringLiteral("ThumbCreator")); - for (const KService::Ptr& service : plugins) { - const bool configurable = service->property(QStringLiteral("Configurable"), QVariant::Bool).toBool(); - const bool show = m_enabledPreviewPlugins.contains(service->desktopEntryName()); + const QVector<KPluginMetaData> plugins = KIO::PreviewJob::availableThumbnailerPlugins(); + for (const KPluginMetaData &plugin : plugins) { + const bool configurable = plugin.value(QStringLiteral("Configurable"), false); + const bool show = m_enabledPreviewPlugins.contains(plugin.pluginId()); model->insertRow(0); const QModelIndex index = model->index(0, 0); model->setData(index, show, Qt::CheckStateRole); model->setData(index, configurable, ServiceModel::ConfigurableRole); - model->setData(index, service->name(), Qt::DisplayRole); - model->setData(index, service->desktopEntryName(), ServiceModel::DesktopEntryNameRole); + model->setData(index, plugin.name(), Qt::DisplayRole); + model->setData(index, plugin.pluginId(), ServiceModel::DesktopEntryNameRole); } model->sort(Qt::DisplayRole); |
