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/views/versioncontrol/kversioncontrolplugin.h | |
| 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/views/versioncontrol/kversioncontrolplugin.h')
| -rw-r--r-- | src/views/versioncontrol/kversioncontrolplugin.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/views/versioncontrol/kversioncontrolplugin.h b/src/views/versioncontrol/kversioncontrolplugin.h index aeac5ad29..c908be247 100644 --- a/src/views/versioncontrol/kversioncontrolplugin.h +++ b/src/views/versioncontrol/kversioncontrolplugin.h @@ -23,14 +23,15 @@ class KFileItem; * steps are required (in the example below it is assumed that a plugin for * Subversion will be written): * - * - Create a fileviewsvnplugin.desktop file with the following content: + * - Create a fileviewsvnplugin.json file with the following content: * <code> - * [Desktop Entry] - * Type=Service - * Name=Subversion - * X-KDE-ServiceTypes=FileViewVersionControlPlugin - * MimeType=text/plain; - * X-KDE-Library=fileviewsvnplugin + * { + * "KPlugin": { + * "Description": "The svn plugin", + * "Name": "Svn" + * } + * } + * </code> * * - Create a class FileViewSvnPlugin derived from KVersionControlPlugin and @@ -45,15 +46,13 @@ class KFileItem; * <code> * #include <KPluginFactory> * #include <KPluginLoader> - * K_PLUGIN_FACTORY(FileViewSvnPluginFactory, registerPlugin<FileViewSvnPlugin>();) - * K_EXPORT_PLUGIN(FileViewSvnPluginFactory("fileviewsvnplugin")) + * K_PLUGIN_CLASS_WITH_JSON(FileViewSvnPlugin, "fileviewsvnplugin.json") * </code> * * - Add the following lines to your CMakeLists.txt file: * <code> - * kde4_add_plugin(fileviewsvnplugin fileviewsvnplugin.cpp) - * target_link_libraries(fileviewsvnplugin konq) - * install(FILES fileviewsvnplugin.desktop DESTINATION ${SERVICES_INSTALL_DIR}) + * kcoreaddons_add_plugin(fileviewsvnplugin SOURCES fileviewsvnplugin.cpp INSTALL_NAMESPACE "dolphin/vcs") + * target_link_libraries(fileviewsvnplugin DolphinVcs) * </code> * * General implementation notes: |
