diff options
| author | Tobias Fella <[email protected]> | 2021-04-05 10:37:28 +0000 |
|---|---|---|
| committer | Elvis Angelaccio <[email protected]> | 2021-04-05 10:37:28 +0000 |
| commit | 30371aedc80bb4e94481058182ab2ad25e35daf9 (patch) | |
| tree | 8273bb2a1f988a4bdd016dbfc69f271ad6a9e9ab /src/settings | |
| parent | d97782809a1698124913400c13d12da816ceb1a0 (diff) | |
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.
Diffstat (limited to 'src/settings')
| -rw-r--r-- | src/settings/contextmenu/contextmenusettingspage.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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<QString> loadedPlugins; + + const QVector<KPluginMetaData> 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, |
