aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perforce/perforceplugin.h
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2020-01-30 12:31:47 +0100
committerhjk <hjk@qt.io>2020-01-31 12:36:23 +0000
commitb8fe25db258da13a2f7a4e44fcf8845a512af6bf (patch)
treeb5692e17963cc05ca437198b969889d3d78a7b4a /src/plugins/perforce/perforceplugin.h
parenta35a2d6bf3f9525c6ba3cead820c13046c0e70b5 (diff)
Vcs: Merge IVersionControl and VcsBasePlugin hierarchies
They were 1:1 in parallel, with quite a bit of function call ping-pong inbetween, for code-sharing-by-inheritance. Merge them by making VcsBasePlugin inherit IVersionControl and merge the derived classes below. Size of this patch is hard to avoid as all seven systems have to move simultaneously. Non-necessary potential follow-up cleanup have been left out on purpose. Change-Id: Icb71e4182af3db21069cc637e7ae87ffa3829791 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/perforce/perforceplugin.h')
-rw-r--r--src/plugins/perforce/perforceplugin.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h
index eaf698aebae..6bb7721ab4c 100644
--- a/src/plugins/perforce/perforceplugin.h
+++ b/src/plugins/perforce/perforceplugin.h
@@ -29,6 +29,8 @@
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/iversioncontrol.h>
+
+#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcsbaseplugin.h>
#include <QObject>
@@ -76,8 +78,28 @@ class PerforcePluginPrivate final : public VcsBase::VcsBasePluginPrivate
public:
PerforcePluginPrivate();
- bool managesDirectory(const QString &directory, QString *topLevel = nullptr);
- bool managesFile(const QString &workingDirectory, const QString &fileName) const;
+ // IVersionControl
+ QString displayName() const final { return {"perforce"}; }
+ Core::Id id() const final { return Core::Id(VcsBase::Constants::VCS_ID_PERFORCE); }
+
+ bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final;
+ bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const final;
+ bool managesFile(const QString &workingDirectory, const QString &fileName) const final;
+
+ bool isConfigured() const final;
+ bool supportsOperation(Operation operation) const final;
+ OpenSupportMode openSupportMode(const QString &fileName) const final;
+ bool vcsOpen(const QString &fileName) final;
+ SettingsFlags settingsFlags() const final;
+ bool vcsAdd(const QString &fileName) final;
+ bool vcsDelete(const QString &filename) final;
+ bool vcsMove(const QString &from, const QString &to) final;
+ bool vcsCreateRepository(const QString &directory) final;
+ bool vcsAnnotate(const QString &file, int line) final;
+ QString vcsOpenText() const final;
+ QString vcsMakeWritableText() const final;
+
+ ///
bool vcsOpen(const QString &workingDir, const QString &fileName, bool silently = false);
bool vcsAdd(const QString &workingDir, const QString &fileName);
bool vcsDelete(const QString &workingDir, const QString &filename);
@@ -203,8 +225,6 @@ private:
bool revertProject(const QString &workingDir, const QStringList &args, bool unchangedOnly);
bool managesDirectoryFstat(const QString &directory);
- static PerforceVersionControl *perforceVersionControl();
-
Core::CommandLocator *m_commandLocator = nullptr;
Utils::ParameterAction *m_editAction = nullptr;
Utils::ParameterAction *m_addAction = nullptr;