Git: Minor cleanup in ChangeSelectionDialog

Change-Id: Icca80b6588be7a4f1fe5601cae89df19f65e2a5d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2019-06-10 21:25:23 +03:00
committed by Orgad Shaneh
parent 578cdf7c5a
commit d0b4b190a6
2 changed files with 9 additions and 37 deletions

View File

@@ -76,15 +76,15 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
connect(m_ui->selectFromHistoryButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::selectCommitFromRecentHistory);
connect(m_ui->showButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptShow);
this, std::bind(&ChangeSelectionDialog::accept, this, Show));
connect(m_ui->cherryPickButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptCherryPick);
this, std::bind(&ChangeSelectionDialog::accept, this, CherryPick));
connect(m_ui->revertButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptRevert);
this, std::bind(&ChangeSelectionDialog::accept, this, Revert));
connect(m_ui->checkoutButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptCheckout);
this, std::bind(&ChangeSelectionDialog::accept, this, Checkout));
connect(m_ui->archiveButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::acceptArchive);
this, std::bind(&ChangeSelectionDialog::accept, this, Archive));
if (id == "Git.Revert")
m_ui->revertButton->setDefault(true);
@@ -151,34 +151,10 @@ ChangeCommand ChangeSelectionDialog::command() const
return m_command;
}
void ChangeSelectionDialog::acceptArchive()
void ChangeSelectionDialog::accept(ChangeCommand command)
{
m_command = Archive;
accept();
}
void ChangeSelectionDialog::acceptCheckout()
{
m_command = Checkout;
accept();
}
void ChangeSelectionDialog::acceptCherryPick()
{
m_command = CherryPick;
accept();
}
void ChangeSelectionDialog::acceptRevert()
{
m_command = Revert;
accept();
}
void ChangeSelectionDialog::acceptShow()
{
m_command = Show;
accept();
m_command = command;
QDialog::accept();
}
//! Set commit message in details

View File

@@ -69,11 +69,7 @@ private:
void recalculateCompletion();
void recalculateDetails();
void changeTextChanged(const QString &text);
void acceptArchive();
void acceptCheckout();
void acceptCherryPick();
void acceptRevert();
void acceptShow();
void accept(ChangeCommand command);
void enableButtons(bool b);
void terminateProcess();