diff options
author | hjk <hjk121@nokiamail.com> | 2014-08-27 18:55:41 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-08-28 16:37:00 +0200 |
commit | 5f7e89d914920d3b9fa0798c233af5c96cf7cf28 (patch) | |
tree | 2de6540ec517101781d7f79940a2c5bd4e0c588d /src/plugins/bazaar | |
parent | 29532a69712fa02de8aa5704ff75c9825dec81a2 (diff) | |
download | qt-creator-5f7e89d914920d3b9fa0798c233af5c96cf7cf28.tar.gz |
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>
Diffstat (limited to 'src/plugins/bazaar')
-rw-r--r-- | src/plugins/bazaar/bazaarclient.cpp | 44 | ||||
-rw-r--r-- | src/plugins/bazaar/bazaarclient.h | 6 | ||||
-rw-r--r-- | src/plugins/bazaar/clonewizard.cpp | 19 | ||||
-rw-r--r-- | src/plugins/bazaar/clonewizard.h | 2 |
4 files changed, 38 insertions, 33 deletions
diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index 0004b37006..6a9ff8e956 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -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); diff --git a/src/plugins/bazaar/bazaarclient.h b/src/plugins/bazaar/bazaarclient.h index 8896d933fa..1239d72740 100644 --- a/src/plugins/bazaar/bazaarclient.h +++ b/src/plugins/bazaar/bazaarclient.h @@ -63,9 +63,9 @@ public: bool managesFile(const QString &workingDirectory, const QString &fileName) const; protected: - Core::Id vcsEditorKind(VcsCommand cmd) const; - QString vcsCommandString(VcsCommand cmd) const; - Utils::ExitCodeInterpreter *exitCodeInterpreter(VcsCommand cmd, QObject *parent) const; + Core::Id vcsEditorKind(VcsCommandTag cmd) const; + QString vcsCommandString(VcsCommandTag cmd) const; + Utils::ExitCodeInterpreter *exitCodeInterpreter(VcsCommandTag cmd, QObject *parent) const; QStringList revisionSpec(const QString &revision) const; VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, const QStringList &files, diff --git a/src/plugins/bazaar/clonewizard.cpp b/src/plugins/bazaar/clonewizard.cpp index c41cc177b9..ab5a3ab2c9 100644 --- a/src/plugins/bazaar/clonewizard.cpp +++ b/src/plugins/bazaar/clonewizard.cpp @@ -35,34 +35,36 @@ #include "bazaarsettings.h" #include <coreplugin/iversioncontrol.h> -#include <vcsbase/command.h> +#include <vcsbase/vcscommand.h> #include <vcsbase/vcsbaseconstants.h> #include <vcsbase/vcsconfigurationpage.h> #include <QDebug> -using namespace Bazaar::Internal; +using namespace VcsBase; +namespace Bazaar { +namespace Internal { // -------------------------------------------------------------------- // CloneWizard: // -------------------------------------------------------------------- CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) : - VcsBase::BaseCheckoutWizard(path, parent) + BaseCheckoutWizard(path, parent) { setTitle(tr("Cloning")); setStartedStatus(tr("Cloning started...")); const Core::IVersionControl *vc = BazaarPlugin::instance()->versionControl(); if (!vc->isConfigured()) - addPage(new VcsBase::VcsConfigurationPage(vc)); + addPage(new VcsConfigurationPage(vc)); CloneWizardPage *page = new CloneWizardPage; page->setPath(path.toString()); addPage(page); } -VcsBase::Command *CloneWizard::createCommand(Utils::FileName *checkoutDir) +VcsCommand *CloneWizard::createCommand(Utils::FileName *checkoutDir) { const CloneWizardPage *cwp = 0; foreach (int pageId, pageIds()) { @@ -99,8 +101,11 @@ VcsBase::Command *CloneWizard::createCommand(Utils::FileName *checkoutDir) args << client->vcsCommandString(BazaarClient::CloneCommand) << extraOptions << cwp->repository() << cwp->directory(); - VcsBase::Command *command = new VcsBase::Command(settings.binaryPath(), cwp->path(), - client->processEnvironment()); + VcsCommand *command = new VcsCommand(settings.binaryPath(), cwp->path(), + client->processEnvironment()); command->addJob(args, -1); return command; } + +} // namespace Internal +} // namespace Bazaar diff --git a/src/plugins/bazaar/clonewizard.h b/src/plugins/bazaar/clonewizard.h index 20a273acd4..7aeafcf0fb 100644 --- a/src/plugins/bazaar/clonewizard.h +++ b/src/plugins/bazaar/clonewizard.h @@ -44,7 +44,7 @@ public: CloneWizard(const Utils::FileName &path, QWidget *parent = 0); protected: - VcsBase::Command *createCommand(Utils::FileName *checkoutDir); + VcsBase::VcsCommand *createCommand(Utils::FileName *checkoutDir); }; } // namespace Internal |