aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/mercurial
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-01-22 13:53:03 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-01-22 14:19:13 +0100
commit2ce93c2b7d431f08cb7ec8ea3416ab0292803176 (patch)
treee4b96b659d09f85576e024778412451bdf35a5f5 /src/plugins/mercurial
parent03c9b935de0885656ca23cb448187db0fbeda453 (diff)
Mercurial: Sprinkle with auto
Change-Id: Id2a4adb5c4759e64affed8c5988feb58389ec1ea Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r--src/plugins/mercurial/clonewizard.cpp8
-rw-r--r--src/plugins/mercurial/mercurialplugin.cpp14
2 files changed, 9 insertions, 13 deletions
diff --git a/src/plugins/mercurial/clonewizard.cpp b/src/plugins/mercurial/clonewizard.cpp
index 9648b7310a..94c734fd62 100644
--- a/src/plugins/mercurial/clonewizard.cpp
+++ b/src/plugins/mercurial/clonewizard.cpp
@@ -54,11 +54,11 @@ CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) :
const Core::IVersionControl *vc = MercurialPlugin::instance()->versionControl();
if (!vc->isConfigured()) {
- VcsConfigurationPage *configPage = new VcsConfigurationPage;
+ auto configPage = new VcsConfigurationPage;
configPage->setVersionControl(vc);
addPage(configPage);
}
- CloneWizardPage *page = new CloneWizardPage;
+ auto page = new CloneWizardPage;
page->setPath(path.toString());
addPage(page);
}
@@ -82,8 +82,8 @@ VcsCommand *CloneWizard::createCommand(Utils::FileName *checkoutDir)
QStringList args;
args << QLatin1String("clone") << cwp->repository() << directory;
*checkoutDir = Utils::FileName::fromString(path + QLatin1Char('/') + directory);
- VcsCommand *command = new VcsCommand(settings.binaryPath(), path,
- QProcessEnvironment::systemEnvironment());
+ auto command = new VcsCommand(settings.binaryPath(), path,
+ QProcessEnvironment::systemEnvironment());
command->addJob(args, -1);
return command;
}
diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp
index c736c0763a..8bbc6e4d7d 100644
--- a/src/plugins/mercurial/mercurialplugin.cpp
+++ b/src/plugins/mercurial/mercurialplugin.cpp
@@ -320,12 +320,9 @@ void MercurialPlugin::statusCurrentFile()
void MercurialPlugin::createDirectoryActions(const Core::Context &context)
{
- QAction *action;
- Core::Command *command;
-
- action = new QAction(tr("Diff"), this);
+ auto action = new QAction(tr("Diff"), this);
m_repositoryActionList.append(action);
- command = Core::ActionManager::registerAction(action, Core::Id(Constants::DIFFMULTI), context);
+ Core::Command *command = Core::ActionManager::registerAction(action, Core::Id(Constants::DIFFMULTI), context);
connect(action, SIGNAL(triggered()), this, SLOT(diffRepository()));
m_mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command);
@@ -387,7 +384,7 @@ void MercurialPlugin::statusMulti()
void MercurialPlugin::createRepositoryActions(const Core::Context &context)
{
- QAction *action = new QAction(tr("Pull..."), this);
+ auto action = new QAction(tr("Pull..."), this);
m_repositoryActionList.append(action);
Core::Command *command = Core::ActionManager::registerAction(action, Core::Id(Constants::PULL), context);
connect(action, SIGNAL(triggered()), this, SLOT(pull()));
@@ -517,10 +514,9 @@ void MercurialPlugin::outgoing()
void MercurialPlugin::createSubmitEditorActions()
{
Core::Context context(Constants::COMMIT_ID);
- Core::Command *command;
editorCommit = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
- command = Core::ActionManager::registerAction(editorCommit, Core::Id(Constants::COMMIT), context);
+ Core::Command *command = Core::ActionManager::registerAction(editorCommit, Core::Id(Constants::COMMIT), context);
command->setAttribute(Core::Command::CA_UpdateText);
connect(editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor()));
@@ -649,7 +645,7 @@ void MercurialPlugin::createRepositoryManagementActions(const Core::Context &con
//TODO create menu for these options
Q_UNUSED(context);
return;
- // QAction *action = new QAction(tr("Branch"), this);
+ // auto action = new QAction(tr("Branch"), this);
// actionList.append(action);
// Core::Command *command = Core::ActionManager::registerAction(action, Constants::BRANCH, context);
// // connect(action, SIGNAL(triggered()), this, SLOT(branch()));