┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/contextmenu/contextmenusettingspage.cpp
diff options
context:
space:
mode:
authorAlexander Lohnau <[email protected]>2021-04-24 11:17:20 +0200
committerAlexander Lohnau <[email protected]>2021-05-10 07:32:20 +0200
commit8f9bf0fe36546d152b860f0c5fd8d00c23dcb648 (patch)
treeb6387d5fe99014255adf75eca5538a1e3e8f564e /src/settings/contextmenu/contextmenusettingspage.cpp
parentb734cedbbf9df0775762b6c58556c03e52a7759a (diff)
Put code for desktop file plugin loading in KIO version check
Loading plugins by their desktop files was deprecated in https://invent.kde.org/frameworks/kio/-/merge_requests/416. Task: https://phabricator.kde.org/T12250
Diffstat (limited to 'src/settings/contextmenu/contextmenusettingspage.cpp')
-rw-r--r--src/settings/contextmenu/contextmenusettingspage.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp
index 8631b0ceb..18b16083b 100644
--- a/src/settings/contextmenu/contextmenusettingspage.cpp
+++ b/src/settings/contextmenu/contextmenusettingspage.cpp
@@ -21,6 +21,8 @@
#include <KServiceTypeTrader>
#include <KDesktopFileActions>
+#include <kio_version.h>
+
#include <QGridLayout>
#include <QLabel>
#include <QListWidget>
@@ -272,7 +274,8 @@ void ContextMenuSettingsPage::loadServices()
}
}
- // Load service plugins that implement the KFileItemActionPlugin interface
+ // Load service plugins, this is deprecated in KIO 5.82
+#if KIO_VERSION < QT_VERSION_CHECK(6, 0, 0)
const KService::List pluginServices = KServiceTypeTrader::self()->query(QStringLiteral("KFileItemAction/Plugin"));
for (const KService::Ptr &service : pluginServices) {
const QString desktopEntryName = service->desktopEntryName();
@@ -281,11 +284,10 @@ void ContextMenuSettingsPage::loadServices()
addRow(service->icon(), service->name(), desktopEntryName, checked);
}
}
+#endif
// Load JSON-based plugins that implement the KFileItemActionPlugin interface
- const auto jsonPlugins = KPluginLoader::findPlugins(QStringLiteral("kf5/kfileitemaction"), [](const KPluginMetaData& metaData) {
- return metaData.serviceTypes().contains(QLatin1String("KFileItemAction/Plugin"));
- });
+ const auto jsonPlugins = KPluginLoader::findPlugins(QStringLiteral("kf5/kfileitemaction"));
for (const auto &jsonMetadata : jsonPlugins) {
const QString desktopEntryName = jsonMetadata.pluginId();