Configurability of individual preview plugins has been deprecated since KIO
5.87.
#include "configurepreviewplugindialog.h"
#include "configurepreviewplugindialog.h"
+#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
+
#include <KIO/DeleteJob>
#include <KIO/JobUiDelegate>
#include <KIO/ThumbCreator>
#include <KIO/DeleteJob>
#include <KIO/JobUiDelegate>
#include <KIO/ThumbCreator>
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
okButton->setDefault(true);
}
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
okButton->setDefault(true);
}
#ifndef CONFIGUREPREVIEWPLUGINDIALOG_H
#define CONFIGUREPREVIEWPLUGINDIALOG_H
#ifndef CONFIGUREPREVIEWPLUGINDIALOG_H
#define CONFIGUREPREVIEWPLUGINDIALOG_H
+#include <QtGlobal>
+#include <kiowidgets_export.h>
+
+#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
+
QWidget* parent);
~ConfigurePreviewPluginDialog() override = default;
};
QWidget* parent);
~ConfigurePreviewPluginDialog() override = default;
};
+#endif // KIOWIDGETS_BUILD_DEPRECATED_SINCE
m_listView = new QListView(this);
QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
m_listView = new QListView(this);
QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
+#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView);
connect(delegate, &ServiceItemDelegate::requestServiceConfiguration,
this, &PreviewsSettingsPage::configureService);
ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView);
connect(delegate, &ServiceItemDelegate::requestServiceConfiguration,
this, &PreviewsSettingsPage::configureService);
+ m_listView->setItemDelegate(delegate);
+#endif
ServiceModel* serviceModel = new ServiceModel(this);
QSortFilterProxyModel* proxyModel = new QSortFilterProxyModel(this);
ServiceModel* serviceModel = new ServiceModel(this);
QSortFilterProxyModel* proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_listView->setModel(proxyModel);
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
m_listView->setModel(proxyModel);
- m_listView->setItemDelegate(delegate);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
m_listView->setUniformItemSizes(true);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
m_listView->setUniformItemSizes(true);
SettingsPageBase::showEvent(event);
}
SettingsPageBase::showEvent(event);
}
+#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
void PreviewsSettingsPage::configureService(const QModelIndex& index)
{
const QAbstractItemModel* model = index.model();
void PreviewsSettingsPage::configureService(const QModelIndex& index)
{
const QAbstractItemModel* model = index.model();
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
void PreviewsSettingsPage::loadPreviewPlugins()
{
void PreviewsSettingsPage::loadPreviewPlugins()
{
const QVector<KPluginMetaData> plugins = KIO::PreviewJob::availableThumbnailerPlugins();
for (const KPluginMetaData &plugin : plugins) {
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);
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, plugin.name(), Qt::DisplayRole);
model->setData(index, plugin.pluginId(), ServiceModel::DesktopEntryNameRole);
model->setData(index, plugin.name(), Qt::DisplayRole);
model->setData(index, plugin.pluginId(), ServiceModel::DesktopEntryNameRole);
+
+#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
+ const bool configurable = plugin.value(QStringLiteral("Configurable"), false);
+ model->setData(index, configurable, ServiceModel::ConfigurableRole);
+#endif
}
model->sort(Qt::DisplayRole);
}
model->sort(Qt::DisplayRole);
#ifndef PREVIEWSSETTINGSPAGE_H
#define PREVIEWSSETTINGSPAGE_H
#ifndef PREVIEWSSETTINGSPAGE_H
#define PREVIEWSSETTINGSPAGE_H
+
+#include <kiowidgets_export.h>
+
#include "settings/settingspagebase.h"
class QSpinBox;
#include "settings/settingspagebase.h"
class QSpinBox;
void showEvent(QShowEvent* event) override;
private Q_SLOTS:
void showEvent(QShowEvent* event) override;
private Q_SLOTS:
+#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
void configureService(const QModelIndex& index);
void configureService(const QModelIndex& index);
private:
void loadPreviewPlugins();
private:
void loadPreviewPlugins();