Commit 6fb754e6 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

VCS: Add id to IVersionControl

... and all derived classes
parent 0b1cc0f4
......@@ -34,6 +34,7 @@
#include "bazaarclient.h"
#include <vcsbase/vcsbaseclientsettings.h>
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QFileInfo>
#include <QtCore/QVariant>
......@@ -52,6 +53,11 @@ QString BazaarControl::displayName() const
return tr("Bazaar");
}
QString BazaarControl::id() const
{
return QLatin1String(VCSBase::Constants::VCS_ID_BAZAAR);
}
bool BazaarControl::managesDirectory(const QString &directory, QString *topLevel) const
{
QFileInfo dir(directory);
......
......@@ -53,6 +53,8 @@ public:
explicit BazaarControl(BazaarClient *bazaarClient);
QString displayName() const;
QString id() const;
bool managesDirectory(const QString &filename, QString *topLevel = 0) const;
bool isConfigured() const;
bool supportsOperation(Operation operation) const;
......
......@@ -64,6 +64,7 @@ public:
virtual ~IVersionControl() {}
virtual QString displayName() const = 0;
virtual QString id() const = 0;
/*!
* Returns whether files in this directory should be managed with this
......
......@@ -34,6 +34,8 @@
#include "cvsplugin.h"
#include "cvssettings.h"
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QFileInfo>
using namespace CVS;
......@@ -49,6 +51,11 @@ QString CVSControl::displayName() const
return QLatin1String("cvs");
}
QString CVSControl::id() const
{
return QLatin1String(VCSBase::Constants::VCS_ID_CVS);
}
bool CVSControl::isConfigured() const
{
const QString binary = m_plugin->settings().cvsCommand;
......
......@@ -47,6 +47,7 @@ class CVSControl : public Core::IVersionControl
public:
explicit CVSControl(CVSPlugin *plugin);
QString displayName() const;
QString id() const;
bool managesDirectory(const QString &directory, QString *topLevel = 0) const;
......
......@@ -36,6 +36,7 @@
#include "gitutils.h"
#include <utils/qtcassert.h>
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QDebug>
#include <QtCore/QFileInfo>
......@@ -56,6 +57,11 @@ QString GitVersionControl::displayName() const
return QLatin1String("git");
}
QString GitVersionControl::id() const
{
return QLatin1String(VCSBase::Constants::VCS_ID_GIT);
}
bool GitVersionControl::isConfigured() const
{
bool ok = false;
......
......@@ -48,6 +48,7 @@ public:
explicit GitVersionControl(GitClient *plugin);
QString displayName() const;
QString id() const;
bool managesDirectory(const QString &directory, QString *topLevel) const;
......
......@@ -34,6 +34,7 @@
#include "mercurialclient.h"
#include <vcsbase/vcsbaseclientsettings.h>
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QFileInfo>
#include <QtCore/QVariant>
......@@ -52,6 +53,11 @@ QString MercurialControl::displayName() const
return tr("Mercurial");
}
QString MercurialControl::id() const
{
return QLatin1String(VCSBase::Constants::VCS_ID_MERCURIAL);
}
bool MercurialControl::managesDirectory(const QString &directory, QString *topLevel) const
{
QFileInfo dir(directory);
......
......@@ -53,6 +53,7 @@ public:
explicit MercurialControl(MercurialClient *mercurialClient);
QString displayName() const;
QString id() const;
bool managesDirectory(const QString &filename, QString *topLevel = 0) const;
bool isConfigured() const;
bool supportsOperation(Operation operation) const;
......
......@@ -35,6 +35,8 @@
#include "perforceconstants.h"
#include "perforcesettings.h"
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
......@@ -51,6 +53,11 @@ QString PerforceVersionControl::displayName() const
return QLatin1String("perforce");
}
QString PerforceVersionControl::id() const
{
return QLatin1String(VCSBase::Constants::VCS_ID_PERFORCE);
}
bool PerforceVersionControl::isConfigured() const
{
const QString binary = m_plugin->settings().p4Command();
......
......@@ -47,6 +47,7 @@ public:
explicit PerforceVersionControl(PerforcePlugin *plugin);
QString displayName() const;
QString id() const;
bool managesDirectory(const QString &directory, QString *topLevel = 0) const;
......
......@@ -34,6 +34,8 @@
#include "subversionplugin.h"
#include "subversionsettings.h"
#include <vcsbase/vcsbaseconstants.h>
#include <QtCore/QFileInfo>
using namespace Subversion;
......@@ -49,6 +51,11 @@ QString SubversionControl::displayName() const
return QLatin1String("subversion");
}
QString SubversionControl::id() const
{
return QLatin1String(VCSBase::Constants::VCS_ID_SUBVERSION);
}
bool SubversionControl::isConfigured() const
{
const QString binary = m_plugin->settings().svnCommand;
......
......@@ -47,6 +47,7 @@ class SubversionControl : public Core::IVersionControl
public:
explicit SubversionControl(SubversionPlugin *plugin);
QString displayName() const;
QString id() const;
bool managesDirectory(const QString &directory, QString *topLevel = 0) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment