mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-21 09:20:13 +00:00
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
This commit is contained in:
parent
b734cedbbf
commit
8f9bf0fe36
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue