#include "previewssettingspage.h"
-#include "configurepreviewplugindialog.h"
#include "dolphin_generalsettings.h"
-#include "settings/serviceitemdelegate.h"
#include "settings/servicemodel.h"
#include <KIO/PreviewJob>
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);
- m_listView->setItemDelegate(delegate);
-#endif
-
ServiceModel *serviceModel = new ServiceModel(this);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
proxyModel->setSourceModel(serviceModel);
m_enabledPreviewPlugins.clear();
for (int i = 0; i < rowCount; ++i) {
const QModelIndex index = model->index(i, 0);
- const bool checked = model->data(index, Qt::CheckStateRole).toBool();
+ const bool checked = model->data(index, Qt::CheckStateRole).value<Qt::CheckState>() == Qt::Checked;
if (checked) {
const QString enabledPlugin = model->data(index, Qt::UserRole).toString();
m_enabledPreviewPlugins.append(enabledPlugin);
SettingsPageBase::showEvent(event);
}
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-void PreviewsSettingsPage::configureService(const QModelIndex &index)
-{
- const QAbstractItemModel *model = index.model();
- const QString pluginName = model->data(index).toString();
- const QString desktopEntryName = model->data(index, ServiceModel::DesktopEntryNameRole).toString();
-
- ConfigurePreviewPluginDialog *dialog = new ConfigurePreviewPluginDialog(pluginName, desktopEntryName, this);
- dialog->setAttribute(Qt::WA_DeleteOnClose);
- dialog->show();
-}
-#endif
-
void PreviewsSettingsPage::loadPreviewPlugins()
{
QAbstractItemModel *model = m_listView->model();
model->insertRow(0);
const QModelIndex index = model->index(0, 0);
- model->setData(index, show, Qt::CheckStateRole);
+ model->setData(index, show ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole);
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);