┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDāvis Mosāns <[email protected]>2023-02-06 21:44:09 +0000
committerDāvis Mosāns <[email protected]>2023-03-04 23:49:48 +0000
commitd0fd5e3869e485b47757cc999b428a443d6aff5a (patch)
tree118b5b20f45f53e6c1ed93a2ff64b77269b562b9
parentb44b4806cb1a16cf8b414b504de6f46cf45dc52f (diff)
Remove deprecated ConfigurePreviewPluginDialog
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/settings/general/configurepreviewplugindialog.cpp71
-rw-r--r--src/settings/general/configurepreviewplugindialog.h36
-rw-r--r--src/settings/general/previewssettingspage.cpp25
-rw-r--r--src/settings/general/previewssettingspage.h3
5 files changed, 0 insertions, 139 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d9e40dc5f..ca0fbe8f7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -288,7 +288,6 @@ target_sources(dolphinstatic PRIVATE
selectionmode/bottombarcontentscontainer.cpp
selectionmode/topbar.cpp
settings/general/behaviorsettingspage.cpp
- settings/general/configurepreviewplugindialog.cpp
settings/general/confirmationssettingspage.cpp
settings/general/generalsettingspage.cpp
settings/general/previewssettingspage.cpp
@@ -347,7 +346,6 @@ target_sources(dolphinstatic PRIVATE
selectionmode/bottombarcontentscontainer.h
selectionmode/topbar.h
settings/general/behaviorsettingspage.h
- settings/general/configurepreviewplugindialog.h
settings/general/confirmationssettingspage.h
settings/general/generalsettingspage.h
settings/general/previewssettingspage.h
@@ -524,7 +522,6 @@ if(NOT WIN32)
settings/kcm/kcmdolphingeneral.cpp
settings/general/behaviorsettingspage.cpp
settings/general/previewssettingspage.cpp
- settings/general/configurepreviewplugindialog.cpp
settings/general/confirmationssettingspage.cpp
settings/settingspagebase.cpp
settings/serviceitemdelegate.cpp
@@ -532,7 +529,6 @@ if(NOT WIN32)
settings/kcm/kcmdolphingeneral.h
settings/general/behaviorsettingspage.h
settings/general/previewssettingspage.h
- settings/general/configurepreviewplugindialog.h
settings/general/confirmationssettingspage.h
settings/settingspagebase.h
settings/serviceitemdelegate.h
diff --git a/src/settings/general/configurepreviewplugindialog.cpp b/src/settings/general/configurepreviewplugindialog.cpp
deleted file mode 100644
index a391812df..000000000
--- a/src/settings/general/configurepreviewplugindialog.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "configurepreviewplugindialog.h"
-
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-
-#include <KIO/DeleteJob>
-#include <KIO/JobUiDelegate>
-#include <KIO/ThumbCreator>
-#include <KJobWidgets>
-#include <KLocalizedString>
-#include <QPluginLoader>
-
-#include <QDialogButtonBox>
-#include <QPushButton>
-#include <QStandardPaths>
-#include <QUrl>
-#include <QVBoxLayout>
-
-ConfigurePreviewPluginDialog::ConfigurePreviewPluginDialog(const QString &pluginName, const QString &desktopEntryName, QWidget *parent)
- : QDialog(parent)
-{
- QSharedPointer<ThumbCreator> previewPlugin;
- const QString pluginPath = QPluginLoader(desktopEntryName).fileName();
- if (!pluginPath.isEmpty()) {
- newCreator create = (newCreator)QLibrary::resolve(pluginPath, "new_creator");
- if (create) {
- previewPlugin.reset(dynamic_cast<ThumbCreator *>(create()));
- }
- }
-
- setWindowTitle(i18nc("@title:window", "Configure Preview for %1", pluginName));
- setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
- setMinimumWidth(400);
-
- auto layout = new QVBoxLayout(this);
-
- if (previewPlugin) {
- auto configurationWidget = previewPlugin->createConfigurationWidget();
- configurationWidget->setParent(this);
- layout->addWidget(configurationWidget);
-
- layout->addStretch();
-
- connect(this, &ConfigurePreviewPluginDialog::accepted, this, [=] {
- // TODO: It would be great having a mechanism to tell PreviewJob that only previews
- // for a specific MIME-type should be regenerated. As this is not available yet we
- // delete the whole thumbnails directory.
- previewPlugin->writeConfiguration(configurationWidget);
-
- // https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DIRECTORY
- const QString thumbnailsPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/thumbnails/");
- KIO::del(QUrl::fromLocalFile(thumbnailsPath), KIO::HideProgressInfo);
- });
- }
-
- auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
- connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfigurePreviewPluginDialog::accept);
- connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfigurePreviewPluginDialog::reject);
- layout->addWidget(buttonBox);
-
- auto okButton = buttonBox->button(QDialogButtonBox::Ok);
- okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- okButton->setDefault(true);
-}
-
-#endif // KIO_VERSION
diff --git a/src/settings/general/configurepreviewplugindialog.h b/src/settings/general/configurepreviewplugindialog.h
deleted file mode 100644
index 66504cce2..000000000
--- a/src/settings/general/configurepreviewplugindialog.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2011 Peter Penz <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#ifndef CONFIGUREPREVIEWPLUGINDIALOG_H
-#define CONFIGUREPREVIEWPLUGINDIALOG_H
-
-#include <kiowidgets_export.h>
-
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
-
-#include <QDialog>
-
-/**
- * @brief Dialog for configuring preview-plugins.
- */
-class ConfigurePreviewPluginDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- /**
- * @param pluginName User visible name of the plugin
- * @param desktopEntryName The name of the plugin that is noted in the desktopentry.
- * Is used to instantiate the plugin to get the configuration
- * widget.
- * @param parent Parent widget.
- */
- ConfigurePreviewPluginDialog(const QString &pluginName, const QString &desktopEntryName, QWidget *parent);
- ~ConfigurePreviewPluginDialog() override = default;
-};
-#endif // KIOWIDGETS_BUILD_DEPRECATED_SINCE
-
-#endif
diff --git a/src/settings/general/previewssettingspage.cpp b/src/settings/general/previewssettingspage.cpp
index 358798f58..fa715237a 100644
--- a/src/settings/general/previewssettingspage.cpp
+++ b/src/settings/general/previewssettingspage.cpp
@@ -6,7 +6,6 @@
#include "previewssettingspage.h"
-#include "configurepreviewplugindialog.h"
#include "dolphin_generalsettings.h"
#include "settings/serviceitemdelegate.h"
#include "settings/servicemodel.h"
@@ -45,12 +44,6 @@ PreviewsSettingsPage::PreviewsSettingsPage(QWidget *parent)
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);
@@ -150,19 +143,6 @@ void PreviewsSettingsPage::showEvent(QShowEvent *event)
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();
@@ -176,11 +156,6 @@ void PreviewsSettingsPage::loadPreviewPlugins()
model->setData(index, show, 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);
diff --git a/src/settings/general/previewssettingspage.h b/src/settings/general/previewssettingspage.h
index 2c3e4dfef..d6d22ae21 100644
--- a/src/settings/general/previewssettingspage.h
+++ b/src/settings/general/previewssettingspage.h
@@ -40,9 +40,6 @@ protected:
void showEvent(QShowEvent *event) override;
private Q_SLOTS:
-#if KIOWIDGETS_BUILD_DEPRECATED_SINCE(5, 87)
- void configureService(const QModelIndex &index);
-#endif
private:
void loadPreviewPlugins();