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

@@ -39,35 +39,35 @@
#include <QTextStream>
#include <QDebug>
using namespace Utils;
using namespace VcsBase;
namespace Bazaar {
namespace Internal {
class BazaarDiffExitCodeInterpreter : public Utils::ExitCodeInterpreter
class BazaarDiffExitCodeInterpreter : public ExitCodeInterpreter
{
Q_OBJECT
public:
BazaarDiffExitCodeInterpreter(QObject *parent) : Utils::ExitCodeInterpreter(parent) {}
Utils::SynchronousProcessResponse::Result interpretExitCode(int code) const;
BazaarDiffExitCodeInterpreter(QObject *parent) : ExitCodeInterpreter(parent) {}
SynchronousProcessResponse::Result interpretExitCode(int code) const;
};
Utils::SynchronousProcessResponse::Result BazaarDiffExitCodeInterpreter::interpretExitCode(int code) const
SynchronousProcessResponse::Result BazaarDiffExitCodeInterpreter::interpretExitCode(int code) const
{
if (code < 0 || code > 2)
return Utils::SynchronousProcessResponse::FinishedError;
return Utils::SynchronousProcessResponse::Finished;
return SynchronousProcessResponse::FinishedError;
return SynchronousProcessResponse::Finished;
}
BazaarClient::BazaarClient(BazaarSettings *settings) :
VcsBase::VcsBaseClient(settings)
VcsBaseClient(settings)
{
}
BazaarSettings *BazaarClient::settings() const
{
return dynamic_cast<BazaarSettings *>(VcsBase::VcsBaseClient::settings());
return dynamic_cast<BazaarSettings *>(VcsBaseClient::settings());
}
bool BazaarClient::synchronousSetUserId()
@@ -143,10 +143,10 @@ QString BazaarClient::findTopLevelForFile(const QFileInfo &file) const
const QString repositoryCheckFile =
QLatin1String(Constants::BAZAARREPO) + QLatin1String("/branch-format");
return file.isDir() ?
VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(),
repositoryCheckFile) :
VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absolutePath(),
repositoryCheckFile);
VcsBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(),
repositoryCheckFile) :
VcsBasePlugin::findRepositoryForDirectory(file.absolutePath(),
repositoryCheckFile);
}
bool BazaarClient::managesFile(const QString &workingDirectory, const QString &fileName) const
@@ -166,7 +166,7 @@ void BazaarClient::view(const QString &source, const QString &id, const QStringL
VcsBaseClient::view(source, id, args);
}
Core::Id BazaarClient::vcsEditorKind(VcsCommand cmd) const
Core::Id BazaarClient::vcsEditorKind(VcsCommandTag cmd) const
{
switch (cmd) {
case AnnotateCommand:
@@ -180,7 +180,7 @@ Core::Id BazaarClient::vcsEditorKind(VcsCommand cmd) const
}
}
QString BazaarClient::vcsCommandString(VcsCommand cmd) const
QString BazaarClient::vcsCommandString(VcsCommandTag cmd) const
{
switch (cmd) {
case CloneCommand:
@@ -190,7 +190,7 @@ QString BazaarClient::vcsCommandString(VcsCommand cmd) const
}
}
Utils::ExitCodeInterpreter *BazaarClient::exitCodeInterpreter(VcsCommand cmd, QObject *parent) const
ExitCodeInterpreter *BazaarClient::exitCodeInterpreter(VcsCommandTag cmd, QObject *parent) const
{
switch (cmd) {
case DiffCommand:
@@ -269,13 +269,13 @@ struct BazaarCommandParameters
};
// Parameter widget controlling whitespace diff mode, associated with a parameter
class BazaarDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget
class BazaarDiffParameterWidget : public VcsBaseEditorParameterWidget
{
Q_OBJECT
public:
BazaarDiffParameterWidget(BazaarClient *client,
const BazaarCommandParameters &p, QWidget *parent = 0) :
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(BazaarSettings::diffIgnoreWhiteSpaceKey));
@@ -306,20 +306,20 @@ private:
const BazaarCommandParameters m_params;
};
VcsBase::VcsBaseEditorParameterWidget *BazaarClient::createDiffEditor(
VcsBaseEditorParameterWidget *BazaarClient::createDiffEditor(
const QString &workingDir, const QStringList &files, const QStringList &extraOptions)
{
const BazaarCommandParameters parameters(workingDir, files, extraOptions);
return new BazaarDiffParameterWidget(this, parameters);
}
class BazaarLogParameterWidget : public VcsBase::VcsBaseEditorParameterWidget
class BazaarLogParameterWidget : public VcsBaseEditorParameterWidget
{
Q_OBJECT
public:
BazaarLogParameterWidget(BazaarClient *client,
const BazaarCommandParameters &p, QWidget *parent = 0) :
VcsBase::VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p)
VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p)
{
BazaarSettings *settings = m_client->settings();
mapSetting(addToggleButton(QLatin1String("--verbose"), tr("Verbose"),
@@ -351,7 +351,7 @@ private:
const BazaarCommandParameters m_params;
};
VcsBase::VcsBaseEditorParameterWidget *BazaarClient::createLogEditor(
VcsBaseEditorParameterWidget *BazaarClient::createLogEditor(
const QString &workingDir, const QStringList &files, const QStringList &extraOptions)
{
const BazaarCommandParameters parameters(workingDir, files, extraOptions);