From 2ce93c2b7d431f08cb7ec8ea3416ab0292803176 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 22 Jan 2015 13:53:03 +0100 Subject: [PATCH] Mercurial: Sprinkle with auto Change-Id: Id2a4adb5c4759e64affed8c5988feb58389ec1ea Reviewed-by: Orgad Shaneh --- src/plugins/mercurial/clonewizard.cpp | 8 ++++---- src/plugins/mercurial/mercurialplugin.cpp | 14 +++++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/plugins/mercurial/clonewizard.cpp b/src/plugins/mercurial/clonewizard.cpp index 9648b7310ab..94c734fd62f 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 c736c0763ab..8bbc6e4d7dd 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()));