]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/general/previewssettingspage.cpp
Merge branch 'release/21.12'
[dolphin.git] / src / settings / general / previewssettingspage.cpp
index 38caa6b7080263c2ad0326fff09db50931c3d20c..f12338aef0f2afa4712cec402cb1547cc65f3e3f 100644 (file)
@@ -94,8 +94,8 @@ PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) :
     loadSettings();
 
     connect(m_listView, &QListView::clicked, this, &PreviewsSettingsPage::changed);
-    connect(m_localFileSizeBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &PreviewsSettingsPage::changed);
-    connect(m_remoteFileSizeBox, QOverload<int>::of(&QSpinBox::valueChanged), this, &PreviewsSettingsPage::changed);
+    connect(m_localFileSizeBox, &QSpinBox::valueChanged, this, &PreviewsSettingsPage::changed);
+    connect(m_remoteFileSizeBox, &QSpinBox::valueChanged, this, &PreviewsSettingsPage::changed);
 }
 
 PreviewsSettingsPage::~PreviewsSettingsPage()
@@ -134,6 +134,7 @@ void PreviewsSettingsPage::applySettings()
     globalConfig.writeEntry("MaximumRemoteSize",
                             maximumRemoteSize,
                             KConfigBase::Normal | KConfigBase::Global);
+
     globalConfig.sync();
 }
 
@@ -167,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);