forked from qt-creator/qt-creator
Git: Minor cleanup in GitSubmitEditorWidget
Accept CommitData struct instead of passing most of its members separately. Change-Id: I04b3b7ea0c02d12cae87e42d44af3808722b6371 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
33001a866f
commit
4cf75c78ac
@@ -130,7 +130,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d)
|
||||
m_amendSHA1 = d.amendSHA1;
|
||||
|
||||
GitSubmitEditorWidget *w = submitEditorWidget();
|
||||
w->initialize(m_commitType, m_workingDirectory, d.panelData, d.panelInfo, d.enablePush);
|
||||
w->initialize(m_workingDirectory, d);
|
||||
w->setHasUnmerged(false);
|
||||
|
||||
setEmptyFileListEnabled(m_commitType == AmendCommit); // Allow for just correcting the message
|
||||
|
@@ -158,18 +158,14 @@ void GitSubmitEditorWidget::setHasUnmerged(bool e)
|
||||
m_hasUnmerged = e;
|
||||
}
|
||||
|
||||
void GitSubmitEditorWidget::initialize(CommitType commitType,
|
||||
const FilePath &repository,
|
||||
const GitSubmitEditorPanelData &data,
|
||||
const GitSubmitEditorPanelInfo &info,
|
||||
bool enablePush)
|
||||
void GitSubmitEditorWidget::initialize(const FilePath &repository, const CommitData &data)
|
||||
{
|
||||
if (m_isInitialized)
|
||||
return;
|
||||
m_isInitialized = true;
|
||||
if (commitType != AmendCommit)
|
||||
if (data.commitType != AmendCommit)
|
||||
m_gitSubmitPanel->showHeadLabel->hide();
|
||||
if (commitType == FixupCommit) {
|
||||
if (data.commitType == FixupCommit) {
|
||||
auto logChangeGroupBox = new QGroupBox(tr("Select Change"));
|
||||
auto logChangeLayout = new QVBoxLayout;
|
||||
logChangeGroupBox->setLayout(logChangeLayout);
|
||||
@@ -182,10 +178,10 @@ void GitSubmitEditorWidget::initialize(CommitType commitType,
|
||||
hideDescription();
|
||||
}
|
||||
insertTopWidget(m_gitSubmitPanel);
|
||||
setPanelData(data);
|
||||
setPanelInfo(info);
|
||||
setPanelData(data.panelData);
|
||||
setPanelInfo(data.panelInfo);
|
||||
|
||||
if (enablePush) {
|
||||
if (data.enablePush) {
|
||||
auto menu = new QMenu(this);
|
||||
connect(menu->addAction(tr("&Commit only")), &QAction::triggered,
|
||||
this, &GitSubmitEditorWidget::commitOnlySlot);
|
||||
|
@@ -64,11 +64,7 @@ public:
|
||||
GitSubmitEditorPanelData panelData() const;
|
||||
QString amendSHA1() const;
|
||||
void setHasUnmerged(bool e);
|
||||
void initialize(CommitType commitType,
|
||||
const Utils::FilePath &repository,
|
||||
const GitSubmitEditorPanelData &data,
|
||||
const GitSubmitEditorPanelInfo &info,
|
||||
bool enablePush);
|
||||
void initialize(const Utils::FilePath &repository, const CommitData &data);
|
||||
void refreshLog(const Utils::FilePath &repository);
|
||||
|
||||
protected:
|
||||
|
Reference in New Issue
Block a user