Vcs: Some naming re-organization

Rename VcsCommand to VcsCommandTag, Command into VcsCommand
(Too generic to not mistake for Core::Command IMNSHO),
remove the now unneeded namespace qualification when not needed,
adjust surrounding code.

Change-Id: Iceb18a21e5e6dffa1a622241286f766985bb8d22
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-08-27 18:55:41 +02:00
parent 29532a6971
commit 5f7e89d914
40 changed files with 424 additions and 406 deletions

View File

@@ -32,11 +32,13 @@
#include "cvsplugin.h"
#include <coreplugin/iversioncontrol.h>
#include <vcsbase/command.h>
#include <vcsbase/vcscommand.h>
#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcsconfigurationpage.h>
#include <utils/qtcassert.h>
using namespace VcsBase;
namespace Cvs {
namespace Internal {
@@ -45,17 +47,17 @@ namespace Internal {
// --------------------------------------------------------------------
CheckoutWizard::CheckoutWizard(const Utils::FileName &path, QWidget *parent) :
VcsBase::BaseCheckoutWizard(path, parent)
BaseCheckoutWizard(path, parent)
{
const Core::IVersionControl *vc = CvsPlugin::instance()->versionControl();
if (!vc->isConfigured())
addPage(new VcsBase::VcsConfigurationPage(vc));
addPage(new VcsConfigurationPage(vc));
CheckoutWizardPage *cwp = new CheckoutWizardPage;
cwp->setPath(path.toString());
addPage(cwp);
}
VcsBase::Command *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
VcsCommand *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
{
// Collect parameters for the checkout command.
// CVS does not allow for checking out into a different directory.
@@ -75,8 +77,8 @@ VcsBase::Command *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
const QString workingDirectory = cwp->path();
*checkoutDir = Utils::FileName::fromString(workingDirectory + QLatin1Char('/') + repository);
VcsBase::Command *command = new VcsBase::Command(binary, workingDirectory,
QProcessEnvironment::systemEnvironment());
VcsCommand *command = new VcsCommand(binary, workingDirectory,
QProcessEnvironment::systemEnvironment());
command->addJob(settings.addOptions(args), -1);
return command;
}

View File

@@ -44,7 +44,7 @@ public:
CheckoutWizard(const Utils::FileName &path, QWidget *parent = 0);
protected:
VcsBase::Command *createCommand(Utils::FileName *checkoutDir);
VcsBase::VcsCommand *createCommand(Utils::FileName *checkoutDir);
};
} // namespace Internal

View File

@@ -42,23 +42,26 @@
#include <QTextStream>
#include <QDebug>
using namespace Utils;
using namespace VcsBase;
namespace Cvs {
namespace Internal {
class CvsDiffExitCodeInterpreter : public Utils::ExitCodeInterpreter
class CvsDiffExitCodeInterpreter : public ExitCodeInterpreter
{
Q_OBJECT
public:
CvsDiffExitCodeInterpreter(QObject *parent) : Utils::ExitCodeInterpreter(parent) {}
Utils::SynchronousProcessResponse::Result interpretExitCode(int code) const;
CvsDiffExitCodeInterpreter(QObject *parent) : ExitCodeInterpreter(parent) {}
SynchronousProcessResponse::Result interpretExitCode(int code) const;
};
Utils::SynchronousProcessResponse::Result CvsDiffExitCodeInterpreter::interpretExitCode(int code) const
SynchronousProcessResponse::Result CvsDiffExitCodeInterpreter::interpretExitCode(int code) const
{
if (code < 0 || code > 2)
return Utils::SynchronousProcessResponse::FinishedError;
return Utils::SynchronousProcessResponse::Finished;
return SynchronousProcessResponse::FinishedError;
return SynchronousProcessResponse::Finished;
}
// Collect all parameters required for a diff to be able to associate them
@@ -71,7 +74,7 @@ struct CvsDiffParameters
};
// Parameter widget controlling whitespace diff mode, associated with a parameter
class CvsDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget
class CvsDiffParameterWidget : public VcsBaseEditorParameterWidget
{
Q_OBJECT
public:
@@ -90,7 +93,7 @@ private:
CvsDiffParameterWidget::CvsDiffParameterWidget(CvsClient *client,
const CvsDiffParameters &p,
QWidget *parent)
: VcsBase::VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p)
: VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p)
{
mapSetting(addToggleButton(QLatin1String("-w"), tr("Ignore Whitespace")),
client->settings()->boolPointer(CvsSettings::diffIgnoreWhiteSpaceKey));
@@ -112,16 +115,16 @@ void CvsDiffParameterWidget::executeCommand()
}
CvsClient::CvsClient(CvsSettings *settings) :
VcsBase::VcsBaseClient(settings)
VcsBaseClient(settings)
{
}
CvsSettings *CvsClient::settings() const
{
return dynamic_cast<CvsSettings *>(VcsBase::VcsBaseClient::settings());
return dynamic_cast<CvsSettings *>(VcsBaseClient::settings());
}
Core::Id CvsClient::vcsEditorKind(VcsCommand cmd) const
Core::Id CvsClient::vcsEditorKind(VcsCommandTag cmd) const
{
switch (cmd) {
case DiffCommand:
@@ -131,7 +134,7 @@ Core::Id CvsClient::vcsEditorKind(VcsCommand cmd) const
}
}
Utils::ExitCodeInterpreter *CvsClient::exitCodeInterpreter(VcsCommand cmd, QObject *parent) const
ExitCodeInterpreter *CvsClient::exitCodeInterpreter(VcsCommandTag cmd, QObject *parent) const
{
switch (cmd) {
case DiffCommand:
@@ -159,13 +162,13 @@ QStringList CvsClient::revisionSpec(const QString &revision) const
return QStringList();
}
VcsBase::VcsBaseClient::StatusItem CvsClient::parseStatusLine(const QString &line) const
VcsBaseClient::StatusItem CvsClient::parseStatusLine(const QString &line) const
{
Q_UNUSED(line)
return VcsBase::VcsBaseClient::StatusItem();
return VcsBaseClient::StatusItem();
}
VcsBase::VcsBaseEditorParameterWidget *CvsClient::createDiffEditor(
VcsBaseEditorParameterWidget *CvsClient::createDiffEditor(
const QString &workingDir, const QStringList &files, const QStringList &extraOptions)
{
Q_UNUSED(extraOptions)

View File

@@ -54,8 +54,8 @@ public:
protected:
Utils::ExitCodeInterpreter *exitCodeInterpreter(VcsCommand cmd, QObject *parent) const;
Core::Id vcsEditorKind(VcsCommand cmd) const;
Utils::ExitCodeInterpreter *exitCodeInterpreter(VcsCommandTag cmd, QObject *parent) const;
Core::Id vcsEditorKind(VcsCommandTag cmd) const;
VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir,
const QStringList &files,
const QStringList &extraOptions);