]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/versioncontrol/kversioncontrolplugin.h
Merge branch 'release/21.04'
[dolphin.git] / src / views / versioncontrol / kversioncontrolplugin.h
index 0de305d14fc162033e4cfc29c8c44c4f830adb63..c908be24720288b4837cb4200b72070135df48b0 100644 (file)
@@ -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:
@@ -143,6 +142,12 @@ public:
      */
     virtual QString fileName() const = 0;
 
+    /**
+     * Returns the path of the local repository root for the versionned directory
+     * Returns an emtpy QString when directory is not part of a working copy
+     */
+    virtual QString localRepositoryRoot(const QString& directory) const;
+
     /**
      * Is invoked whenever the version control
      * information will get retrieved for the directory
@@ -177,6 +182,7 @@ public:
      * @return List of actions that are available for the out of version control
      *         items \p items. It's opposed to the \p versionedActions. Common usage
      *         is for clone/checkout actions.
+     * @since 21.04
      */
     virtual QList<QAction*> outOfVersionControlActions(const KFileItemList& items) const = 0;