forked from qt-creator/qt-creator
Git: Sprinkle with auto
Change-Id: I13886e17ee49702a69450e0f0b7d161cdfed1385 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -614,7 +614,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
|
||||
local = child;
|
||||
}
|
||||
int pos = positionForName(local, leafName);
|
||||
BranchNode *newNode = new BranchNode(leafName, startSha, track ? trackedBranch : QString());
|
||||
auto newNode = new BranchNode(leafName, startSha, track ? trackedBranch : QString());
|
||||
if (!added)
|
||||
beginInsertRows(nodeToIndex(local), pos, pos);
|
||||
newNode->parent = local;
|
||||
@@ -677,7 +677,7 @@ void BranchModel::parseOutputLine(const QString &line)
|
||||
const QString name = nameParts.last();
|
||||
nameParts.removeLast();
|
||||
|
||||
BranchNode *newNode = new BranchNode(name, sha, lineParts.at(2));
|
||||
auto newNode = new BranchNode(name, sha, lineParts.at(2));
|
||||
root->insert(nameParts, newNode);
|
||||
if (current)
|
||||
m_currentBranch = newNode;
|
||||
|
@@ -85,7 +85,7 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
|
||||
else
|
||||
m_ui->showButton->setDefault(true);
|
||||
m_changeModel = new QStringListModel(this);
|
||||
QCompleter *changeCompleter = new QCompleter(m_changeModel, this);
|
||||
auto changeCompleter = new QCompleter(m_changeModel, this);
|
||||
m_ui->changeNumberEdit->setCompleter(changeCompleter);
|
||||
changeCompleter->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
|
@@ -55,11 +55,11 @@ CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) :
|
||||
|
||||
const Internal::GitVersionControl *vc = Internal::GitPlugin::instance()->gitVersionControl();
|
||||
if (!vc->isConfigured()) {
|
||||
VcsConfigurationPage *configPage = new VcsConfigurationPage;
|
||||
auto configPage = new VcsConfigurationPage;
|
||||
configPage->setVersionControl(vc);
|
||||
addPage(configPage);
|
||||
}
|
||||
CloneWizardPage *cwp = new CloneWizardPage;
|
||||
auto cwp = new CloneWizardPage;
|
||||
cwp->setPath(path.toString());
|
||||
addPage(cwp);
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ VcsCommand *CloneWizardPage::createCheckoutJob(Utils::FileName *checkoutPath) co
|
||||
if (d->recursiveCheckBox->isChecked())
|
||||
args << QLatin1String("--recursive");
|
||||
args << QLatin1String("--progress") << repository() << checkoutDir;
|
||||
VcsCommand *command = new VcsCommand(client->gitExecutable(), workingDirectory,
|
||||
auto command = new VcsCommand(client->gitExecutable(), workingDirectory,
|
||||
client->processEnvironment());
|
||||
command->addFlags(VcsBasePlugin::MergeOutputChannels);
|
||||
command->addJob(args, -1);
|
||||
|
@@ -222,7 +222,7 @@ void GitDiffHandler::postCollectShowDescription(const QString &id)
|
||||
|
||||
m_controller->requestSaveState();
|
||||
m_controller->clear(m_waitMessage);
|
||||
VcsCommand *command = new VcsCommand(gitPath(), m_workingDirectory, processEnvironment());
|
||||
auto command = new VcsCommand(gitPath(), m_workingDirectory, processEnvironment());
|
||||
command->setCodec(m_gitClient->encoding(m_workingDirectory,
|
||||
"i18n.commitEncoding"));
|
||||
connect(command, SIGNAL(output(QString)),
|
||||
@@ -311,7 +311,7 @@ void GitDiffHandler::postCollectTextualDiffOutput(const QString &gitCommand, con
|
||||
|
||||
m_controller->requestSaveState();
|
||||
m_controller->clear(m_waitMessage);
|
||||
VcsCommand *command = new VcsCommand(gitPath(), m_workingDirectory, processEnvironment());
|
||||
auto command = new VcsCommand(gitPath(), m_workingDirectory, processEnvironment());
|
||||
command->setCodec(EditorManager::defaultTextCodec());
|
||||
connect(command, SIGNAL(output(QString)),
|
||||
this, SLOT(slotTextualDiffOutputReceived(QString)));
|
||||
@@ -415,8 +415,7 @@ GitDiffEditorReloader::GitDiffEditorReloader()
|
||||
|
||||
void GitDiffEditorReloader::reload()
|
||||
{
|
||||
GitDiffHandler *handler = new GitDiffHandler(controller(),
|
||||
m_workingDirectory);
|
||||
auto handler = new GitDiffHandler(controller(), m_workingDirectory);
|
||||
connect(handler, SIGNAL(destroyed()), this, SLOT(reloadFinished()));
|
||||
|
||||
switch (m_diffType) {
|
||||
@@ -1011,7 +1010,7 @@ void GitClient::diffBranch(const QString &workingDirectory,
|
||||
void GitClient::merge(const QString &workingDirectory,
|
||||
const QStringList &unmergedFileNames)
|
||||
{
|
||||
MergeTool *mergeTool = new MergeTool(this);
|
||||
auto mergeTool = new MergeTool(this);
|
||||
if (!mergeTool->start(workingDirectory, unmergedFileNames))
|
||||
delete mergeTool;
|
||||
}
|
||||
@@ -1715,7 +1714,7 @@ void GitClient::branchesForCommit(const QString &revision)
|
||||
DiffEditor::DiffEditorController *controller
|
||||
= qobject_cast<DiffEditor::DiffEditorController *>(sender());
|
||||
QString workingDirectory = controller->workingDirectory();
|
||||
VcsCommand *command = new VcsCommand(gitExecutable(), workingDirectory, processEnvironment());
|
||||
auto command = new VcsCommand(gitExecutable(), workingDirectory, processEnvironment());
|
||||
command->setCodec(getSourceCodec(currentDocumentPath()));
|
||||
|
||||
connect(command, SIGNAL(output(QString)), controller,
|
||||
@@ -2117,7 +2116,7 @@ VcsCommand *GitClient::createCommand(const QString &workingDirectory,
|
||||
bool useOutputToWindow,
|
||||
int editorLineNumber)
|
||||
{
|
||||
VcsCommand *command = new VcsCommand(gitExecutable(), workingDirectory, processEnvironment());
|
||||
auto command = new VcsCommand(gitExecutable(), workingDirectory, processEnvironment());
|
||||
command->setCodec(getSourceCodec(currentDocumentPath()));
|
||||
command->setCookie(QVariant(editorLineNumber));
|
||||
if (editor) {
|
||||
@@ -2576,7 +2575,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
||||
// the child), but that does not have an environment parameter.
|
||||
bool success = false;
|
||||
if (!settings()->stringValue(GitSettings::pathKey).isEmpty()) {
|
||||
QProcess *process = new QProcess(this);
|
||||
auto process = new QProcess(this);
|
||||
process->setWorkingDirectory(workingDirectory);
|
||||
process->setProcessEnvironment(env);
|
||||
process->start(binary, arguments);
|
||||
|
@@ -226,7 +226,7 @@ QAction *GitPlugin::createRepositoryAction(ActionContainer *ac,
|
||||
const Context &context, bool addToLocator,
|
||||
const QKeySequence &keys)
|
||||
{
|
||||
QAction *action = new QAction(text, this);
|
||||
auto action = new QAction(text, this);
|
||||
Core::Command *command = ActionManager::registerAction(action, id, context);
|
||||
if (!keys.isEmpty())
|
||||
command->setDefaultKeySequence(keys);
|
||||
|
@@ -94,8 +94,8 @@ void GitSubmitEditorWidget::initialize(CommitType commitType,
|
||||
return;
|
||||
m_isInitialized = true;
|
||||
if (commitType == FixupCommit) {
|
||||
QGroupBox *logChangeGroupBox = new QGroupBox(tr("Select Change"));
|
||||
QVBoxLayout *logChangeLayout = new QVBoxLayout;
|
||||
auto logChangeGroupBox = new QGroupBox(tr("Select Change"));
|
||||
auto logChangeLayout = new QVBoxLayout;
|
||||
logChangeGroupBox->setLayout(logChangeLayout);
|
||||
m_logChangeWidget = new LogChangeWidget;
|
||||
m_logChangeWidget->init(repository);
|
||||
@@ -110,7 +110,7 @@ void GitSubmitEditorWidget::initialize(CommitType commitType,
|
||||
setPanelInfo(info);
|
||||
|
||||
if (enablePush) {
|
||||
QMenu *menu = new QMenu(this);
|
||||
auto menu = new QMenu(this);
|
||||
menu->addAction(tr("&Commit only"), this, SLOT(commitOnlySlot()));
|
||||
menu->addAction(tr("Commit and &Push"), this, SLOT(commitAndPushSlot()));
|
||||
menu->addAction(tr("Commit and Push to &Gerrit"), this, SLOT(commitAndPushToGerritSlot()));
|
||||
|
@@ -171,7 +171,7 @@ bool LogChangeWidget::populateLog(const QString &repository, const QString &comm
|
||||
if (colonPos != -1) {
|
||||
QList<QStandardItem *> row;
|
||||
for (int c = 0; c < ColumnCount; ++c) {
|
||||
QStandardItem *item = new QStandardItem;
|
||||
auto item = new QStandardItem;
|
||||
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
|
||||
if (line.endsWith(QLatin1Char(')'))) {
|
||||
QFont font = item->font();
|
||||
@@ -206,10 +206,10 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) :
|
||||
, m_dialogButtonBox(new QDialogButtonBox(this))
|
||||
, m_resetTypeComboBox(0)
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->addWidget(new QLabel(isReset ? tr("Reset to:") : tr("Select change:"), this));
|
||||
layout->addWidget(m_widget);
|
||||
QHBoxLayout *popUpLayout = new QHBoxLayout;
|
||||
auto popUpLayout = new QHBoxLayout;
|
||||
if (isReset) {
|
||||
popUpLayout->addWidget(new QLabel(tr("Reset type:"), this));
|
||||
m_resetTypeComboBox = new QComboBox(this);
|
||||
|
@@ -59,11 +59,11 @@ static inline GitClient *gitClient()
|
||||
static inline QList<QStandardItem*> stashModelRowItems(const Stash &s)
|
||||
{
|
||||
Qt::ItemFlags itemFlags = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
QStandardItem *nameItem = new QStandardItem(s.name);
|
||||
auto nameItem = new QStandardItem(s.name);
|
||||
nameItem->setFlags(itemFlags);
|
||||
QStandardItem *branchItem = new QStandardItem(s.branch);
|
||||
auto branchItem = new QStandardItem(s.branch);
|
||||
branchItem->setFlags(itemFlags);
|
||||
QStandardItem *messageItem = new QStandardItem(s.message);
|
||||
auto messageItem = new QStandardItem(s.message);
|
||||
messageItem->setFlags(itemFlags);
|
||||
QList<QStandardItem*> rc;
|
||||
rc << nameItem << branchItem << messageItem;
|
||||
|
Reference in New Issue
Block a user