From 30371aedc80bb4e94481058182ab2ad25e35daf9 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Mon, 5 Apr 2021 10:37:28 +0000 Subject: Port the VCS plugin system to KPluginLoader The loader looks for the plugins in ${QT_PLUGIN_PATH}/dolphin/vcs. The old method of loading the plugins is kept around for now, to support external, legacy plugins. --- src/settings/contextmenu/contextmenusettingspage.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/settings/contextmenu/contextmenusettingspage.cpp') diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp index 0723fee2e..8631b0ceb 100644 --- a/src/settings/contextmenu/contextmenusettingspage.cpp +++ b/src/settings/contextmenu/contextmenusettingspage.cpp @@ -304,9 +304,24 @@ void ContextMenuSettingsPage::loadVersionControlSystems() const QStringList enabledPlugins = VersionControlSettings::enabledPlugins(); // Create a checkbox for each available version control plugin + QSet loadedPlugins; + + const QVector plugins = KPluginLoader::findPlugins(QStringLiteral("dolphin/vcs")); + for (const auto &plugin : plugins) { + const QString pluginName = plugin.name(); + addRow(QStringLiteral("code-class"), + pluginName, + VersionControlServicePrefix + pluginName, + enabledPlugins.contains(pluginName)); + loadedPlugins += pluginName; + } + const KService::List pluginServices = KServiceTypeTrader::self()->query(QStringLiteral("FileViewVersionControlPlugin")); for (const auto &plugin : pluginServices) { const QString pluginName = plugin->name(); + if (loadedPlugins.contains(pluginName)) { + continue; + } addRow(QStringLiteral("code-class"), pluginName, VersionControlServicePrefix + pluginName, -- cgit v1.3